WSQ08 ‘WSQ03 Version 2.0’

This ‘On To Functions’ WSQ is kinda weird. The instructions were the same as WSQ03 with only one difference: Separating the operations from the answer’s printing.

This is how WSQ03 looked like. And this is how it changed:

WSQ08code

It still runs the same in case you were wondering.

WSQ08run

This may be a short post, but the reason is that the changes were minimal. Well then, lets talk about a classic. “The Man Who Sold The World” by David Bowie. Not so long ago, this same man passed away. I always knew about this classic; however, I got the interest into it because of Metal Gear Solid V: The Phantom Pain. Even so it is a cover of this song, the lyrics match what ‘Venom Snake’ is going through. David Bowie gave this song a meaning of existentialism  because he portraits his two selves: the image he sold to the world and the his true self negating each other.

The Man who sold the world

WSQ07 ‘Sum of Numbers’

Ever wondered what is the result of the addition of all the intergers from a certain range? Of course not, but let’s calculate it!

okami doge
Sorry, been playing Okami lately. 

What I mean by ‘Sum of Numbers’, it is for example: from a range of 5 to 10 one has to sum 5 + 6+ 7 + 8 + 9 + 10. This has to be done in order to get the final result of 45.  Sounds easy right? But what if the range was bigger? For example from 1 to 100. One is not going to grab a calculator and start “1+2+3+4+5+6+7+8+9+(…)+100”. Of course not! This is why I was in charge of programming a code were the computer automatically does this.

 

 

I will be using the classic variables “x” and “y” to define the range. This time “x” is the number we begin, and “y” is the number the addition countdown stops. However, I had to make a prediction were the user actually submits “x” higher than “y”. This would me impossible since the program is unable to count backwards. So I used a conditional “If” to let the user know what the mistake is. In the end, this is my code.

WSQ07 code

Looks cool right? It looks better when one uses it.

wsq07run

This blog corresponds to the song “After Midnight” by Blin182. I am not that old, yet I know that band brings nostalgia to most of the 90’s kids. This song was recommended by an old friend of mine, and I have must say thanks to her for introducing me this awesome song.

After Midnight

 

WSQ06 Guess my number

 

picture079
Hello user. I want to play a game.

I am thinking of a number from 1 to 100, and it is not a decimal. Guess it or Game Over!

 

 

 

 

For this WSQ06 we had to program the system to take a number from the range 1 to 100. At this case we have to use the function rand_num and make it interger with randint(1,100) . The main point at this program is to play the “warm or cold” game where you give the player the clue that his guess was higher or lower than the actual number.

This is were one uses the conditionals if and elif, so one predicts all the possible answers from the user. If guess is higher than random number then it prints that the guess is higher. And viceverse if the number is lower.

At first I had troubles printing the “You win!” screen message.
randomnum question

Then I noticed that the last “elif” has to be written as “else” since it is the last option from the conditionals. This is without the actual condition “==”. Also, there was a problem with the indent since “else” has to match the “while” position. Like this:

wsq06 win.png

I did not used a conditional if the user tries a number higher than 100. This is because the program will tell the user to try a lower number. Everything is ready to go. Now let’s play!

wsq06 win

The WSQ06 is over, but I challenge myself to learn how to tell the user’s tries and to limit the game to an actual number of tries. This is in order to make a “Game Over” screen possible.

Today’s blog corresponds to the song “Swing Life Away” by Rise Against. No,  not Rage Against the Machine but Rise Against.  A song

swing life away

Continue reading “WSQ06 Guess my number”

#WSQ05 Temperature

Hola de nuevo 😀

En este programa se nos solicitaba pasar la temperatura de Fahrenheit a Celsius. Tuve muchas trabas se las iré contanto poco a poquito.

Este es el código:

fahh

Muchos pueden decir: ¿En qué se equivoco? Bueno, mis variables las tome de tipo float y mi operación la tenía plateada así: (5/9)*(Fa-32). El resultado siempre me daría cero.

Bueno le pregunte al mismo amigo me enseño a utilizar Cygwin y esta fue la explicación:

Re

Entonces, el resultado era correcto, simpre me daría cero. La solución a esto era poner le a estos un punto(.), o sea, la nueva operación quedaría: (5.0/9.0)*(Fa-32). Problema resuelto.

Bo-

Aquí se nos indica que el agua no hierve debido a la temperatura.

Bo+

Aquí el agua hierve por la temperatura.

Aquí les dejo el GitHub de Temperature.

Chicos, no dejo caja de información debido a que ya sabía usar este if, sí más no me equivoco es el if encadenado el que utilice yo, de todas formas subiré información de esto.

Espero les haya gustado y ayudado, por favor, no olvides comentar.

Gracias. Nos vemos 😉

#WSQ05 #TC1017

 

#WSQ04 Flipped Learning

Hola a todos, mi maestro Ken nos pidió en esta tarea que pusieramos una reflexión en cuanto a la metodología que se esta llevando en las clases, porque sabemos que es algo nuevo para muchos de nosotros.

Esta fue la información que nos proporciono Ken en el curso que tenemos.

  1. A Lecture From the Lectured” – blog post from students
  2. An A+ student regrets his grades” – article from the Globe and Mail from a student after graduating.
  3. Showing the Differences between a Traditional and a Flipped Classroom” – Video from FlippingPhysics, great Physics videos on his site if you want to check those out.

Yo me fui a la última opción y vi el video. Nos muestra la diferencias de una clase rutinaria a una clase activa Flipped. Me gusta que deje las clases para la casa, que por medio de un video, el estudiante vaya al tanto de sus clases en casa y que en el aula, pueda hacer la tarea y preguntarle al profesor algo que no haya entendido.

En nuestra clase, en particular me cuesta adaptarme. Para mí sería más cómodo saber que hay un video respecto al tema, como en el video que vi. Pero igual es cuestión de adaptación, antes no sabía ni como usar el blog y ahorita lo entiendo muy bien en general.

Igual agradecerle al profesor porque igual no te puedes quedar de brazos cruzados y hace que te muevas para investigar como se hacen las cosas.

Esa es mi opinión respecto al curso.

Gracias a todos, recuerda que estamos en contacto. Nos vemos luego 😉

#WSQ04 #TC1017 #Reflection #PuntosMenos #D:

 

 

#WSQ03 Fun With Numbers :D

Hola de nuevo.

El día de hoy les mostrare como hice una serie de operaciones sencillas, como si fuera una calculadora. Esta obtendra la resta de dos numeros, producto, división y residuo… PERO, únicamente de números enteros.

cal.PNG

En este programa utilicé un Switch, que es un menu de opciones donde acomodé la resta de dos numeros, el producto, división y residuo-En la caja de información te dejo los links de donde vi esto-para que el usuario seleccionara la opción que quisiera.

Resalté un pero al princípio, éste debido a que el programa únicamente permitirá la entrada de números enteros y los resultados que arroje de igual manera, serán de números enteros. Entonces ejecutemos. Uilizaremos los mismos pasos que les enseñe en #WSQ02 Hello World & uso de Cygwin

Aquí podemos apreciar la resta.

D

Aquí podemos ver la multiplicación.

P

Aquí podemos apreciar la división, sin embargo, bien sabemos que si dividimos 60/80 nos dara 3/4 que son 0.75, ésto no es un número entero, no obstante, nosotros agregamos los datos y las respuestas como una variable entera, es por ese motivo que el resultado lo arroja como un número entero.

div

La operación del residuo.

R

La opción de “default” es por sí el usuarío no selecciona una de las opciones dadas y en este caso el programa se puede salir automáticamente o envarle un mensaje al usuario informandole la situación. Observa.

De

Mientras iba colocando las imagenes me pregunte que sucedería sí le pongo números con decimales desde el principio, esto fue lo que paso.

Co

El programa colapsa y no funciono como debe.

A este programa le puedo meter un While para me pregunte sí quiero continuar usando el programa. No me acuerdo como era, pero después se los investigo y les paso el código por este medio y por GitHub, ya

Continue reading “#WSQ03 Fun With Numbers :D”

#WSQ02 Hello World & Uso de Cygwin

Muy bien, empezaremos ha hacer nuestro primer programa. Para ello debemos de saber que de cajón siempre van a venir escritas estas lineas de código:

#include<iostream>

using namespace std;

int main()

Cada una tiene su razón de ser claro esta, pero no me enfocaré en eso, sí quieren saber les dejare unos links en la caja de información donde yo busque todo eso.

Bueno, retomando el tema.

Aquí esta mi programa HelloWorld

HelloWorld

Para empezar a poner nuestro código, después haber escrito nuestras tres lineas de cajón se deben de abrir unas llaves {}, donde dentro de ella haremos todo nuestro código.

En este caso no necesitaremos variables o algo por el estilo, únicamente queremos que nuestro programanos diga “Hola Mundo”.

Algo que se me pasó mencionar, mi clase es en inglés pero puedo hacer el blog y mis trabajos en inglés sí gusto, pero únicamente mis programas quieron que sean en inglés. Sí Ken tal vez se vea muy pocho, pero así me siento cómoda, jejej :p .

Bueno, ahora que tenemos el programa debemos a entrar a Cygwin para que lo copile y nos lo corra.

Ok, sí eres alguien que no tiene idea de como se usa, no te preocuopues te explico.

Lo abres y seguramente te aparece esta caja donde no tienes ni la más remota idea de que hacer con ella, tranquilo yo estaba igual y me agobiaba.

C1

Aquí un amigo que está estudiando Ingeniería en sistemas computacionales me ayudo por eso prefiero explicartelo, aunque me imagino que igual hay mucha información en Google, Youtube, en otros Blogs, etc. Pero te diré lo que sé.

Primero vas a buscar donde está tu archivo

arc.png

No se alcanza a apreciar todo pero tengo el archivo en mi escritorio, en una carpeta llamada cuarto semestre y se llama solución de

lin
C2
C4
C5
H
C6

Continue reading “#WSQ02 Hello World & Uso de Cygwin”

#WSQ01

En la primera semana nuestro profesor Ken Bauer -Dejare abajo su Twitter por sí gustan conocerlo- nos pidió que descargaramos lo que es un editor de de código.

Como estoy estudiando para una Ingeniería en Mecatrónica es básico que tenga conocimiento en programación con C++

El editor que estoy usando actualmente es el de Atom. Pero aquí única y exclusicamente puedo escribir mi código.

Atom

Para que yo pueda hacer que el programa me copile y me corra tengo que descargar un recopilador. Para eso tuve que descargar el Cygwin. Este nos permite copilar el programa y ejecutarlo.

Cygwin

Teniendo estos dos amigos, estamos listo para programar.

Estamos en contacto 🙂

-Caja de información-

Aquí les proporcionare los links donde yo pude descargar estos programas, video informativos, lo que me ayudo a mí, etcétera.

Twitter de Ken

Donde descargue Atom

Donde descargue Cygwin

Video de como descargar Cygwin por Ken

Por favor deja tu comentarío 😉

#WSQ01 #TC1017

 

 

WSQ04 “Flipped Learning”

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.”

This was a famous phrase that, according to the internet but not confirmed, was said by Albert Einstein.

This course with Professor Ken Bauer is a ‘Prototype course’ for #AbolishGrades. What does this means? This means that instead of the classic education system where one either ace an exam or fail it in order to judge one’s intelligence one must show what they truly learned at the course. This will be written by using as a source the lecture “An A+ student regrets his grades” from Afraj  Gill.

Lets be real. This may be more common between the ‘millennials’ since they are all around social media over the networks. Is a common meme when one experencies forgeting what one learned trough a year or semester of school. Think about it. Do you remember most of what you answered at last semester’s exam? It could be like that Men In Black movie where one forgets instantly what they just learned.

men in black.jpg

Secondly, have you ever asked what an entrepreneur’s scores where? Of course not! Because that does not matters anymore when one sees how far they have gone. Einstein dropped school for example. Scores are nothing but just numbers to label one, yet it does not define one’s true knowledge.

Now, let’s discuss the experience at Ken Bauer’s class specifically.

exp.pngAs one may recall, the writter of this blog is a begginer at coding. That means that he barely knows what he is doing and how he is going to do it. The expectations for this class were high form him. Because he was expecting a classic educational system so he was sort of afraid

the blakes

Continue reading “WSQ04 “Flipped Learning””

#WSQ08

Hi dudes, this is a new post. It is a post about functions and the program we need to do is the same we did for WSQ03, so if you still have the code use it for this task. If not you could download from my dropbox, https://www.dropbox.com/s/38bcu6bgeaozoi8/fun.cpp?dl=0

So as I said, is the same shit that WSQ03 but using functions for solving each math operation. I am not to good explaining how a functions works and how to be declare, so I will not explain it, I will put a link of a video I watched six months ago, where I learn all that stuff. Also I have to say that there is many different ways to make and use a function, it depends witch one you like the most, it is your style. And I think my style looks very nice and order, but maybe it is kind of confuse and also take a little bit more of time to do it. So as i said is all up to you, you decide to use or not my style. Thanks for reading folks!!

Here is the link: https://www.youtube.com/watch?v=_TuyBjvljak

Captura de pantalla 2016-02-02 a las 12.34.36 p.m.Captura de pantalla 2016-02-02 a las 12.34.53 p.m.Captura de pantalla 2016-02-02 a las 12.35.03 p.m.imagen thanks