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
‘WSQ’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 05:59:33 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Cars https://kenscourses.com/tc101fall2015/2015/cars-4/ Thu, 26 Nov 2015 05:59:33 +0000 http://saldabal.wordpress.com/?p=198 Continue Reading →]]> #Jorge Fernando Saldaña Cabal
#A01350730

archivo = open(“carros.txt”, “r”)
lineas = archivo.readlines()
#def primero:
y = 0
contcity = 0

for i in lineas:
x = (i[52:54])
if (x != “”):
x = float(x)
y = y + x
contcity = contcity + 1
city = y//contcity
print(‘The average gas mileage in city is: ‘,city)
p = 0
conthigh = 0
for i in lineas:
z = (i[55:57])
if (z != “”):
z = float(z)
p = p + z
conthigh = conthigh + 1
high = p // conthigh
print(‘The average gas mileage in highway is: ‘,high)

f = 0
contmind = 0
for i in lineas:
a = (i[42:46])
if (a != “”):
a = float(a)
f = f + a
contmind = contmind + 1
mind = y//contmind
print(‘The average mind-range price is: ‘,mind)

#52

]]>
https://creativecommons.org/licenses/by/4.0/
Estimating e https://kenscourses.com/tc101fall2015/2015/estimating-e-5/ Thu, 26 Nov 2015 05:16:17 +0000 http://saldabal.wordpress.com/?p=170 Continue Reading →]]> This task was not that hard. We had to make a function that computes an estimation of e, which is a number very used in finances. The trick was our number must have the accuracy given by the user.

Here is my code:

https://github.com/sabaldaba/TC101/blob/master/Estimating_e

]]>
https://creativecommons.org/licenses/by/4.0/
Yo soy 196 https://kenscourses.com/tc101fall2015/2015/yo-soy-196-8/ Thu, 26 Nov 2015 05:10:46 +0000 http://saldabal.wordpress.com/?p=165 Continue Reading →]]> This task was of the most challenging ones of the entire course. We had to make a programm to find candidates of lychrel numbers in a given range. First of all i had to look what a lychrel number was because i never heard of it. Then i found out that theres a theory that when you add a number to its inverse ‘n’ times eventually it will become palyndrome which means, if you read it backward it would be the same as if you read it normally.

But there are some numbers that havent been able to prove this theory, i even read that ones, scientifics let a computer programm running for three years in search for its palyndrome, eventually they stopped the programm and found a number of one million digits which is a lot, but never the palyndrome.

I get confused a lot with variables but at the end Ken helped me to fix the last problems, here is my code: https://github.com/sabaldaba/TC101/blob/master/wsq11_soy:196

 

Hope you like it!

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ12 GCD https://kenscourses.com/tc101fall2015/2015/wsq12-gcd/ Wed, 25 Nov 2015 05:47:42 +0000 http://eduardomacielm.wordpress.com/?p=186 Continue Reading →]]> This task was quite easy, it was possible to do only reading about Euclid’s algorithm. Even in wikipedia.

It was just taking both numbers and getting its module, then dividing the second number and the module, until the module was 0.

GCD.cpp

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ16, Finally done… https://kenscourses.com/tc101fall2015/2015/wsq16-finally-done/ Mon, 23 Nov 2015 13:24:00 +0000 http://hrglez.wordpress.com/?p=236 ]]> This one could be the hardest one. “Cars vs. Yo Soy 196” would be a good fight.

And I found out the function “atoi”(it converts strings to integers) is in the “algorithm” library… so good I had BigInteger when doing the “Yo Soy 196”.

I had to research a lot for this one, and learned how to use the substract stuff (like substr() and c_str() )

Here the page that helped me: http://www.cplusplus.com/

And now all I have to say is thanks to Ken, I enjoyed his flipped course a lot, I learned in a way I have never learned before.

An image:

WSQ16

The code:

Thank you, very single one. See you later.

done

 

]]>
https://creativecommons.org/licenses/by/4.0/
Factorial Calculator https://kenscourses.com/tc101fall2015/2015/factorial-calculator-9/ Sat, 21 Nov 2015 10:31:47 +0000 http://saldabal.wordpress.com/?p=110 Continue Reading →]]> For this task i had to make a program that calculates the factorial of a given number, and of course to create a function.

The code i wrote is this: https://github.com/sabaldaba/TC101/blob/master/Wsq09-Factorial

The program at the end also gives you the option of doing another operation or to end, this was done thanks to a while loop while the factorial calculator was done with a for loop since in there i knew a specific range.

Hope you like it!

 

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ17, The last freaking one!! https://kenscourses.com/tc101fall2015/2015/wsq17-the-last-freaking-one/ Fri, 20 Nov 2015 22:50:32 +0000 http://hrglez.wordpress.com/?p=221 ]]> Damn hell I can not believe this is the last WSQ (actually I skipped the WSQ16, but I will done it later).

This was easy a heck, It was just about reading and doing examples.

Now I (kind of) know how to use Scilab, an incredible program that could do almost everything, here some images:

Sci
Sci1
Sci2
Sci3

I highly recommend you to use this program. Have a nice week and happy holidays.

See you!

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ14, Fun with Euler’s number https://kenscourses.com/tc101fall2015/2015/wsq14-fun-with-eulers-number/ Thu, 12 Nov 2015 15:11:54 +0000 http://hrglez.wordpress.com/?p=211 ]]> Hi everybody.

There are only two WSQ’s left, I’m so freaking excited.

The image:

wsq14

The code: https://github.com/hrglez/TC1017/blob/master/WSQ14%20-%20Euler

Hugs for everyone, good luck, work hard. See you!

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ15… The Final Dash!! https://kenscourses.com/tc101fall2015/2015/wsq15-the-final-dash/ Thu, 12 Nov 2015 14:58:34 +0000 http://hrglez.wordpress.com/?p=204 ]]> Hi everyone. I cannot believe the semester is almost over. Thank God, Jesus, Jahavé, Buda, Pachamama, Rá and Alá.

This is suppose to be my plan to finish the semester:

A long weekend is coming, and you are going to see me expending my time in a chair in front of my computer and notebooks (they are going to be like my best friends this weekend).

So after this long weekend I should have finished 16 over the 17 WSQ’s (I think I will have some problems with the 16th).

Working on the final project is of course a priority. I will research a lot and ask Ken about this, because I feel pretty lost in this thing.

quote

About another courses, I kind of screwed, but I am going to done this, I’m sure.

Good luck for everyone!

-So good I will pass this course and never look for programs again.

-Dude, you are studying mechatronics, and this was the first semester.

-Shit…

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ13, Babylon https://kenscourses.com/tc101fall2015/2015/wsq13-babylon/ Thu, 12 Nov 2015 04:12:58 +0000 http://hrglez.wordpress.com/?p=201 ]]> “In the rivers of Babylon”… Hi everybody, this is the post for the WSQ13.

I’m getting closer to the end of this course, fuck yeah!

I do not want to lie, I took the idea from two places:

-This video: https://www.youtube.com/watch?v=sZmz7znP6x0

-This blog: https://modelac.wordpress.com/2007/02/16/ide-uso-en-c-c-raiz-cuadrada-programada-configura-tu-ide/

The image:

wsq13

The code: https://github.com/hrglez/TC1017/blob/master/WSQ13%20-%20Babylonian%20Square%20Root

Good luck fellows! Have a great day.

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