Tag Archives: #WSQ08

#WSQ08

Hello class, I have already done wich is do some operations with funtions, how does it works? well when we create a funtion we can reduce our program a lot, because we can call the funtion every time we want, and in this way we don have do a program many time in our program, and this is what we did here, 

Fisrt of all we have to create a funtion of the add, difference, product, division, and remainder.

After that we will call each funtion in the program to do de operations

At the end we will just print the result in the screen.

 

You can see my program in the next link:

https://www.dropbox.com/s/rt4h2bu48i66209/wsq08.cpp?dl=0

 

I saw some videos in youtube to do this activity 

https://www.youtube.com/watch?v=ZYCTqYvDEI8

On To Functions

I made the last wsq of partial 1. I’ts all about making wsq03 all over again, but now, using functions. Check it out.

On to numbers. WSQ08.

What I did in this WSQ, was a program which perform basic calculations between two numbers, as I did in WSQ03. The difference here, is that this time I’m using functions to perform the calculations. Every calculation has its own function and everyone define two parameters. The program ask the user for the inputs and then, it calls each function to perform the calculations and print its results.

Take a look at my code: https://www.dropbox.com/s/l0sxka8vole3e4m/wsq08.py?dl=0

 

WSQ08

this code does the same as the WSQ03 but in a different way. were are making a function for each part and then calling it again in the cout for the answer. take a look at the the picture and see the different functions for each operation.

#WSQ08

  

 

En esta ocasión debíamos utilizar funciones para que hicieran el trabajo de sumar, restar, multiplicar, dividir y mostrar el residuo de la división que habíamos hecho.

Luis Angel me ayudo a entender como se logra esto. Se logra llamando las funciones anteriores a main y utilizando sus variables.

https://github.com/JuanPabloGonzalezHuezzo/-WSQ08/tree/master

WSQ08 ON TO FUNCTIONS

FUNCIONES

¿Recuerdan el WSQ03?

WSQ08 ON TO FUNCTIONS

Ahora lo haremos con funciones.

Al definir una función, se debe de poner “def”, el nombre de la función y dentro del argumento las variables “x” y “y” que son los números. Lo hice con cada operación, por lo tanto hay un total de 5 funciones.

WSQ08 ON TO FUNCTIONS
Es importante saber que las variables declaradas dentro de una función siempre deben estar dentro en ella porque de lo contrario, el programa no correría.
WSQ08 ON TO FUNCTIONS
Es necesario también poner “x” y  “y” ya declaradas después de las funciones. También no correría el programa bien si no se hace eso. Y a la hora de llamar a las funciones se debe de poner como está en la imagen anterior. Los resultados serían los mismos como el de la WSQ03, solo que se utilizó funciones como la única diferencia.
WSQ08 ON TO FUNCTIONS
WSQ08 ON TO FUNCTIONS
WSQ08 ON TO FUNCTIONS
Este viernes es un poco pesado ¿no?

WSQ08 ON TO FUNCTIONS

FUNCIONES

¿Recuerdan el WSQ03?

WSQ08 ON TO FUNCTIONS

Ahora lo haremos con funciones.

Al definir una función, se debe de poner “def”, el nombre de la función y dentro del argumento las variables “x” y “y” que son los números. Lo hice con cada operación, por lo tanto hay un total de 5 funciones.

WSQ08 ON TO FUNCTIONS
Es importante saber que las variables declaradas dentro de una función siempre deben estar dentro en ella porque de lo contrario, el programa no correría.
WSQ08 ON TO FUNCTIONS
Es necesario también poner “x” y  “y” ya declaradas después de las funciones. También no correría el programa bien si no se hace eso. Y a la hora de llamar a las funciones se debe de poner como está en la imagen anterior. Los resultados serían los mismos como el de la WSQ03, solo que se utilizó funciones como la única diferencia.
WSQ08 ON TO FUNCTIONS
WSQ08 ON TO FUNCTIONS
WSQ08 ON TO FUNCTIONS
Este viernes es un poco pesado ¿no?

On to Functions

This is the same program as the , but in this time I use a funtion to do the mathematical operation in place that direcctly the operations….so here is the code with comments: https://github.com/A01229754/Tc107/blob/master/wsq08.cpp

WSQ08 ON TO FUNCTIONS

 

Here is code and running program and i also uploaded on my dropbox.

link:  https://www.dropbox.com/s/wbvxtd6170i1z30/wsq08.cpp?dl=0

#WSQ08

Here is my , here i´m showing the same program as in but this time i wrote function for each calculation.