Tag Archives: #WSQ03

Learn To Program 2015-01-31 11:50:00

WSQ03
Esta nueva práctica consiste en resolver las operaciones matemáticas básicas (suma, resta, multiplicación, división y módulo)
No es tan difícil como esperaba, pero la clave está en saber el tipo de variables que manejaran los datos. Realicé un video de como elabore la actividad de manera muy rápida, tratando de abarcar todas las partes del problema.
https://www.youtube.com/watch?v=97j1p4gV23Y

**********************
Programa hecho en Python:
**********************
https://gist.githubusercontent.com/A01630323/951f25ca33e3ec02b8ac/raw/0781469638f4a876a804137982fcc7924fa7a853/WSQ03

#WSQ03 Fun With Numbers

1 min read

//Mauricio Cooper A01630042

<iostream>

using namespace std;

int x,y,s,r,p,d,l;

int main () {

cout << “Dame los dos números para jugarn”;

cout << “Introduzca el primer númeron”;

cin >> x;

cout << “Introduzca el segundo númeron”;

cin >> y;

s=x+y ;

cout << “La suma de los dos números es: ” << s << endl;

r=x-y ;

cout << “La diferencia de los dos números es: ”  << r << endl;

p=x*y ;

cout << “El producto de los dos números es: ”  << p << endl; 

d=x/y ;

cout << “La división de los dos números es: ”  << d << endl;

l=x%y ;

cout << “El residuo de la división de los dos números es: ”  << l << endl;

return 0;

 

}

 

 

 #ninjabanana

Click here if you love the CoCo

#WSQ03 Fun with numbers

Simple math, cool programs:#WSQ03 Fun with numbers

#WSQ03 Fun with numbers

Simple math, cool programs:#WSQ03 Fun with numbers

I finished my #WSQ03 at #TC1017! Embedding the video here! With this, simple arithmetic will be finished in no time flat! https://www.youtube.com/watch?v=gf6ndk7IYAM

I finished my at ! Embedding the video here! With this, simple arithmetic will be finished in no time flat!
https://www.youtube.com/watch?v=gf6ndk7IYAM

WSQ03

1 min read

Here’s the code for WSQ03 “Fun with numbers” It was’nt that difficult, my only problem was opening it in Terminal, but ulitmately I fount the way

WSQ03

WSQ03

Little tip for mac users: To get this beautifully cropped screenshots, you have to press Command (⌘)-Shift-4, then press the space bar, and select the window you want to screenshot.

Wsq03

Fun with Numbers

Wsq03


Instructions:
Ask the user for 2 integer numbers, then use those values to calculate:

  1. The sum of the 2 numbers
  2.  Difference between them
  3.  The product 
  4.  The integer based division (no decimal point)
  5.  The remainder of the integer division


    First i looked for math operations with python and found this youtube video:

    Then i had some trouble with my variables because they were strings and i converted them to integers using int (), but after that minor struggle the program runned just fine.
    I’ll leave a link to my code:

    Wsq03

    Fun with Numbers

    Wsq03


    Instructions:
    Ask the user for 2 integer numbers, then use those values to calculate:

    1. The sum of the 2 numbers
    2.  Difference between them
    3.  The product 
    4.  The integer based division (no decimal point)
    5.  The remainder of the integer division


      First i looked for math operations with python and found this youtube video:

      Then i had some trouble with my variables because they were strings and i converted them to integers using int (), but after that minor struggle the program runned just fine.
      I’ll leave a link to my code:

      #TC1014 #WSQ03

      2 min read

      Here’s my code for the #WSQ03, i used these links as a reference to help me deal with this task: http://stackoverflow.com/questions/17651384/python-remove-division-decimal 

      http://stackoverflow.com/questions/5584586/find-the-division-remainder-of-a-number

       I have put some comments in the code to explain what each line does.

      num1 = int(input(“Give me a number: “)) #Asks the user for a number

      num2 = int(input (“Give me another number: “)) #Asks the user for another number

      suma = num1+num2 #this is the variable for the sum of two numbers

      resta= num1-num2  #this is the variable for the difference of two numbers

      multi= num1*num2  #this ios the variable for the product of two numbers

      div=num1/num2 #this is the variable for the division of two numbers

      rem= num1%num2 #this is the variable for the remainder of the division of two numbers

      print (“The sum of your numbers is”, suma) #Shows the user the result of the sum

      print (“The difference of your numbers is”, resta) #Shows the user the result of the difference

      print (“The product of your numbers is”, multi) #Shows the user the result of the product

      print (“The division of your numbers is”, int(div)) #Shows the user the result of the division

      print(“The remainder of the division of your numbers is”, int(rem)) #Shows the user the remainder of the division

      I could have printed every result in one print function but i think it looks better this way. 🙂 #TC1014 #WSQ03 

      Fun with Numbers

      1 min read

      #TC1017 #WSQ03 fun with numbers