#WSQ11 #NadieQuiereSer196

One freaking week breaking my head and having brainstorm ideas to figure out how to write this satanic code(Not even Satan would create something like this) thank God Aguayo for gave me the patience to not freak out and finally finish the code.

As usual here´s the code(yeah i know you´re just coming to my blog for it) click on the random image to go to GitHub[The code won´t work until you install the BigInteger and do all the proccess Ken explains in this VIDEO] and don´t forget to thank Aguayo for his greatness

12800132_10208894747391030_7422022885247348938_n.jpg

I´ve also made a video explaining the code working and its structure so there isn´t any screenshot this time, here it is:

Like always, here some random Tumblr picture again

 

 

WSQ10 ‘Lists’

 

For this one, we were in charge of letting the user sumbit 10 numbers and play with them. The point of this WSQ was to append the 10 numbers that the user sumbits to a list, and us to program different operations with those numbers. In this WSQ, I learned a bunch of codes and strategies. For example:

  • x = [] has to be empty in order to let the user fill the x with the 10 digits he submits.
  • x.append(float(input)) so the program fills x with the digits.
  • import statistics so I am able to use statistics functions since the WSQ requested standar deviation. This is easier than to search for the formula and manually code it.

bulbasaur

At any case this is how the code looks and runs , and here is the GitHub to analyse it closer. I made the comparision with a random webpage to double check it was correct.

WSQ10.png

This blog is sponsored (I wish) by Jack Dolgen’s “I Will Come For You”. As part of How I Met You Mother’s soundtrack, this song is full of feelings. This song is played during one of the saddest moments of the show, episode 19 of season 6. A kid needs a hoop…

I will come for you.png

 

#WSQ09

Hello again, I was too busy for doing post, but now I have some time for doing some posts. Well for this WSQ we where ask for this:

“Create a program that asks the user for a non-negative integer (let’s call that number n) and display for them the value of n! (n factorial).

After showing them the answer, ask them if they would like to try another number (with a simple y/n response) and either ask again (for y) or quit the program and wish them a nice day (if they answered n).”

Well solving this problem was very simple. Fist what I did was to declare two variables, fac and x. Fac is for the number and x if for a yes or not. Then we ask for the first value, the number. And then we call the function.

Captura de pantalla 2016-03-08 a las 12.13.49 p.m.Captura de pantalla 2016-03-08 a las 12.13.59 p.m.

Here is the link for you to download my code and play with it: https://www.dropbox.com/s/idgvdui4oy2djof/fac.c?dl=0

 

WSQ09 Factorials!

This time we have to do factorials. This means n! = (n)(n-1)(n-2)…(1). Multiply n times the previous number until it reaches 1.

For this I used a for in range (1, x + 1) . When x is the value that the user inputs. The, y = y*i so it keeps repeating itself until it becomes 1. Secondly I used conditionals to predict the parameters when x is 0 or when x is a negative, so the program gives the obvious.

Finally, I took a peek at my classmates’s blog to learn what to do in order to let the user try again or exit the program. Thanks to Pxthon Progrxmmer I learned that you can use a while True to make the whole conditionals and the factorial formula work and when it ends let the user try again by typing ‘a’ or exit by typing a different letter.

wsq009.png

Today’s song is ‘Short Change Hero’ by The Heavy. A song that is used at the intro of Borderlands 2 when introducing the main characters. It is an epic way to show the players what they will meet in the world of Pandora because Pandora “ain’t no place for no hero”.

short change hero

#WSQ10(Video)What the heck

Now this is more confusing, we must combine loops, functions, mathematical formulas, a few of all the topics we´ve seen until now.

tumblr_nn0zrg89NJ1sszkwto1_540.png

This code will be completely different to the ones you´ve done before(talking abt myself) well, here´s the code posted on GitHub.

To beggin, add the usual library <iostream> and instead of using the “using namespace std” just determinate which of the parameters of the library you´ll use. Also add the <cmath> library because you must use it for the StandartDeviation part of the code.

The program must ask the user for 10 float values, counting and saving them using a variable in function of another, numbers[i]. Repeting the “for” loop as many times as you give the instructions to the program in the NUMOFNUM variable.

Now what? Well the code must have 3 functions(3 + the main) one, which will calculate the total addition of the numbers the users gave. Secondly, the average of the 10 numbers the user typed and finally, the standart deviation(I´ll explain a lot better in the video bellow what is it and how to get it).

Create the function for the total and in it, the program must do a loop to be adding the next value and to not write everything like(number[1]+number[2]+number[3]…etc.

total

In the next one, the average, you don´t have to add the numbers again, just call the last function and just divide it for the number of values(in this case 10) and there you go, you got the average. As you can see in this part of the code you don´t need to create a new loop, using the result of the addition function is all.

averag.png

Now the third part, the standart deviation(yeah i know, you don´t even know what the heck that means haha me either so i had

28eab7e10b01875cf06fa63ca434e055
stdev_s

Continue reading “#WSQ10(Video)What the heck”

#WSQ08 On To Functions

En este programa realice el mismo programa 3, pero yo lo realice como una calculadora, debido a que te pedía menos cosas en el programa 3, pero, pero, pero… Todo esto fue hecho con funciones.

Les presento como funciona mi programa:

Calcu

Lo que hice es este programa fueron dos loop, funciones y ya.

Este es el código que realice…Bueno, fue un codigo muy largo, pero, aquí se los dejo:

Calcu1

Calcu2

Calcu3

Calcu4

Este es todo mi código, igual más adelante se los dejo en GitHub, para que puedan manejarlo de una mejor manera.

 

 

 

#WSQ07 Sum of Numbers

Hola mundo XD

Esta vez tengo el programa de una suma de numeros aquí se me viene explicando lo que tenemos que hacer.

Basicamente el programa funciona así:

Sum

Lo que hizo el programa fue sumar los números entre el 5 y 9 contando a estos, o sea, 5+6+7+8+9= 35.

Lo que requerimos para esto es el uso de un contador. Lo implementamos de la siguiente forma:

Summ

Lo que esta pasando es que el Number1 está tomando un nuevo valor; se le suma lo que es el número uno cada vez que este entra al ciclo hasta llegar al Number2, cuando éste sea diferente del Number2 automáticamente se cierra el ciclo arrojando lo que es un número.

Esto es todo por el momento, espero que les haya servido.

Nos vemos 🙂

#WSQ04

What do I think about Flipped Learning?

I will be honeste, classic learning is shit and it just freak me out. I would like to say that Lecturing in front of a class is so fucking boring for everybody, including the teacher. Students just sleep, text or talk during all the class because they get so freaking bored. So at the end of the class you learn no shit. And you end up learning by yourself days before the exam. You study hours and hours, trying to learn all the stuff the teacher was supposed to teach you. So it would be more simple if since the begging you start learning by yourself and if something it is really hard you just ask to the teacher.  That ii is flipped learning, it is just learning by yourself, and if you have doubts you ask to your pals or to the teacher. In flipped learning the teacher it is just for answering any doubt you have, not for giving classes boring as fuck. So it would be great to apply this revolutionary system to Tec de Monterrey, and that is how we will say good bye to the fucking exams.

 

#WSQ09 Factorial Video Explanation

Here´s the code, copy it if you want to

Don´t forget the main part of the code, the use of a counter and the condition of the loop, is the most important thing, if you still don´t know how to use loops or what are the loops i recommend you this video, it actually helped me a lot to figure out the logic of the loops.

Check my explanation(in spanish for this time) about how my code works and with it you can check if you have any mistakes or something weird on your code.

Im anxious about doing more WSQ´s, programming is turning one of my fav hobbies.

tumblr_n6xlhdPNxz1rxzj6uo1_500.jpg