WSQ03 ‘Playing with numbers’

3rd week of the semester and Ken’s blog has up to 7 homeworks. That means that I am 4/7 done from right now. Ever wondered how a calculator is programmed to do one’s  work for them? You know when one is too lazy to add 5 + 3 and they use the calculator to make sure or even to do enormous operations for Physics.

At this WSQ we were in charge to make the user pick two numbers. Let “x” be the first number and “y” be the second number. So at this assignment this two numbers picked by the user are supposed to be added to each other , also  x has to be substracted by y, then x and y have to multiply each other and finally x has to be divided by y. However at this division the final result has to be an interger so you have the remainder also. That means no decimal.

My first try at the addition part, with the assistance of my partner, it was a failure since instead of the variables adding each other, they just stood beside each other like this:

sumafail