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
Octavio Rojas’s Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 05:15:49 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Quizz 11 https://kenscourses.com/tc101fall2015/2015/quizz-11-2/ Thu, 26 Nov 2015 05:15:49 +0000 http://octavioirg.wordpress.com/?p=272 ]]> Sorry for the delay I couldn´t make it work (the euler one)  🙁

Here are my github links:

https://github.com/OctavioIRG/TC1017/blob/master/Quiz-cheese/quizz11-1.cpp

https://github.com/OctavioIRG/TC1017/blob/master/Quiz-cheese/quizz11.cpp

 

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 13 https://kenscourses.com/tc101fall2015/2015/mastery-13-11/ Thu, 26 Nov 2015 01:14:42 +0000 http://octavioirg.wordpress.com/?p=265 ]]> Importation and use of libraries on C++ can be hard or easy. It depends on your OS (operative system).

Believe me Windows Users, there is a better world outside and it’s called Linux.

linux on laptop
CC licensed photo by Juan on Flickr. Old school linux. 😉

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 26 https://kenscourses.com/tc101fall2015/2015/mastery-26-4/ Thu, 26 Nov 2015 01:06:35 +0000 http://octavioirg.wordpress.com/?p=258 ]]> This is a wordy mastery. Badum tss! Because is about strings… duh 🙂

So let’s start:

Strings
CC licensed photo by Hernán Piñera on Flickr

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 28 https://kenscourses.com/tc101fall2015/2015/mastery-28/ Thu, 26 Nov 2015 01:00:40 +0000 http://octavioirg.wordpress.com/?p=253 ]]> Reading and writing on files.

This is a very cool tool to use with c++. The first time I used this I was shocked. How can this order work?! I mean, suddenly this type of assgiments have created in me some sort of extreme curiosity about what’s behind a computer. How does this computer I’m writting on works? It’s amazing. How ever, the point here is the mastery so let’s continue.

 

To read a file, and write on a file or do anything to a file you need to include a library called fstream. You know use the familiar “<>” symbols and the #include at the begining of your code.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 26 https://kenscourses.com/tc101fall2015/2015/mastery-26-2/ Wed, 25 Nov 2015 20:04:02 +0000 http://octavioirg.wordpress.com/?p=246 ]]> Creation and use of matrixes.

A matrix is a simple array, but in this case the arrays has two dimensions. We had to use this concept to undestand how to perform the imagemagick challenge.

For those of you that know spanish(haha just kidding…) there is a cool blog that explains this:

https://ronnyml.wordpress.com/2009/07/04/vectores-matrices-y-punteros-en-c/

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 24 https://kenscourses.com/tc101fall2015/2015/mastery-24-8/ Wed, 25 Nov 2015 19:57:31 +0000 http://octavioirg.wordpress.com/?p=238 ]]> Mastery about c++ arrays!

An array is very cool way to store information and a cimple way.

An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.

My video:

That means that, for example, five values of type int can be declared as an array without having to declare 5 different variables (each with its own identifier). Instead, using an array, the five int values are stored in contiguous memory locations, and all five can be accessed using the same identifier, with the proper index.

In simple words, an array is information stored in such a way that you can access each part of your information using a name and an index number.

 

]]>
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/