Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/feed-rss2.php on line 8
‘WSQs’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 01:22:42 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ WSQ11 https://kenscourses.com/tc101fall2015/2015/wsq11-24/ Thu, 26 Nov 2015 01:22:42 +0000 http://5nbppkkyj.wordpress.com/?p=138 ]]> In this WSQ I asked the user for a lower and an upper bound, then I It was challenging but I found that researching and understanding the concept completely was crucial.

https://github.com/DianaJU/Write/blob/master/lychrel.py

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ12 https://kenscourses.com/tc101fall2015/2015/wsq12-28/ Thu, 26 Nov 2015 01:22:12 +0000 http://5nbppkkyj.wordpress.com/?p=151 ]]> This is a program that calculates the greatest common denominator of two positive integers using Euclid’s algorithm.

https://github.com/DianaJU/Write/blob/master/gcd.py

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ13 https://kenscourses.com/tc101fall2015/2015/wsq13-27/ Thu, 26 Nov 2015 01:22:10 +0000 http://5nbppkkyj.wordpress.com/?p=157 ]]> I wrote a program that calculates the square root of a number using the Babylonian method. A function baby receives any number and returns a float.

https://github.com/DianaJU/Write/blob/master/baby.py

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 21 https://kenscourses.com/tc101fall2015/2015/mastery-21-5/ Wed, 25 Nov 2015 19:51:13 +0000 http://octavioirg.wordpress.com/?p=223 ]]> Recursive Daisy
CC licensed photo by Alexandre Duret-Lutz on Flickr

Recursion and stuff…

Welcome to my brand new post. This time I want to show how to use recursion in a very simple function. We already did this in an iterative way and I thought it would be nice to show how to do it in the recursive way. I’m talking about the fibonacci numbers.

Here is a short video explaining an example of the recursive funcition to calculate the fibonacci number of a given index.

Check also this resources to know when to use recursive functions.

http://www.cplusplus.com/articles/D2N36Up4/

In this article the dicussion is set around when to use a recursive function. The answer can’t be easier: when a function calls itself.

Personally, I like cplusplus.com I’ve found useful articles and discussions about many topics. Believe me there’s a post for your questions there.

Here’s another piece of information from cplusplus.com:

http://www.cplusplus.com/forum/articles/2231/

 

 

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 18 https://kenscourses.com/tc101fall2015/2015/mastery-18-5/ Wed, 25 Nov 2015 19:27:01 +0000 http://octavioirg.wordpress.com/?p=210 ]]>  

Osprey Building a Nest
CC licensed photo by Rodney Campbell on Flickr

This post is about mastery number 18. The use of nested conditionals. I explained a simple example in the next video but I would also like to share other resources such as tutorialspoint.com’s exlanation of nested conditionals.

 

My video:

Take a look to it.

http://www.tutorialspoint.com/cplusplus/cpp_nested_if.htm

Another video I watched is about if/else interaction and nesting those loops.

I think the most important conditional that allows nesting is the if. You can read a nested bunch of if’s as: If this is true, the perform this if this is true, perform the next if this is true and so on… You could use opertaros such as && and || (and or) to simplify some nested conditionals and make your code easier.

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ 16 https://kenscourses.com/tc101fall2015/2015/wsq-16/ Wed, 25 Nov 2015 07:14:03 +0000 http://octavioirg.wordpress.com/?p=201 ]]> MmmmHere is my code https://github.com/OctavioIRG/TC1017/blob/master/WSQ-s/run.cpp

Well I got helped and I read Carlo’s solution. The thing is that my answer should work but i had a little problem with the way my number are added.

 

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ13 https://kenscourses.com/tc101fall2015/2015/wsq13-11/ Fri, 20 Nov 2015 22:14:03 +0000 http://octavioirg.wordpress.com/?p=190 ]]> Babilonia 2004
CC licensed photo by EcoFotos Adilson Moralez on flickr.

This is a cool WSQ, in fact this was one of my favorites. Why? Because at first it was hard, nevertheless I did it! Honestly, it took me around two hours to finish this WSQ.

Any way, here is my code:

https://github.com/OctavioIRG/TC1017/commit/a2fc843ad2b3ba057b40c4b2f2becaebdf9f12f5

I thought it would be cool to show the user how the babilonian method starts aproximates to the actual value of the square root, thus I decided to print each cycle.  The cycle breaks when the last and current  value of the squareroot is the same. 🙂

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ 17 https://kenscourses.com/tc101fall2015/2015/wsq-17/ Fri, 20 Nov 2015 21:42:11 +0000 http://octavioirg.wordpress.com/?p=178 ]]> So, it´s the last one…

The purpose of this post I to tell you, my dear reader, my experience with Scilab. In a few words; Scilab is a geat tool, I read the manual and performed almost all the examples. One of the things that surprised me was the 3D Plot tool. More over, it’s pretty awesome to have all the tools in a single window. You can plot, calculate, programm and more in a single platform.

I’m guessing this tool has a enormous potential that unfortunately I can’t use right now but as Ken wrote in the WSQ, I will probably use this tool through my carrer. Thank you Ken!

 

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ 14 https://kenscourses.com/tc101fall2015/2015/wsq-14/ Thu, 19 Nov 2015 22:56:49 +0000 http://octavioirg.wordpress.com/?p=168 ]]> ewwww ....cool
CC licensed photo by Cory Doctorow on Flickr.

Hello everybody, this time I found the instructions confusing, I mean, I tried my best interpreting the instructions and I came up with this:

https://github.com/OctavioIRG/TC1017/blob/master/WSQ-s/eu.cpp

I hope its rigth, I coulnd’t make it print only once the number But it does give you the wirte decimals up to 15 digits after the decimal point. I guess that the varaible I use in the factorial functions isn’t big enough.

Beside those two mistakes (double printing and wrong decimals after 15 digits) the programm works. I did it with out more help than the equation to calculate e so I guess it was a good try.

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ 15 https://kenscourses.com/tc101fall2015/2015/wsq-15/ Thu, 19 Nov 2015 22:31:04 +0000 http://octavioirg.wordpress.com/?p=155 ]]> Take a look to my last weeks calendar.

Week3

Week2

Week4

Yeah… so, many things to do and lack of organization. The worst combination ever. I haven’t finished my final project and I allmost give up with it last week. The only thing I am doing well is the WSQ work.

In the last picture you can see that at the moment of writting these lines I was on supposed to be doing this exact WSQ.

Good luck everybody with your final exams.

]]>
https://creativecommons.org/licenses/by/4.0/