#WSQ01 = Watch, Summarise, Questions

Fun With Numbers

Here I will try to explain how I managed to finish the first assignment.

Here are the instructions:

Ask the user for two integer values, then use those two values to calculate and show the following:

  • The sum of the two numbers.
  • The difference of the two numbers.
  • The product of the two numbers.
  • The integer based division of the two numbers (so no decimal point). First divided by second.
  • The remainder of integer division of the two numbers.

I had to look for the definition these terms:

The user: A system user is a person who interacts with a system, typically through an interface, to extract some functional benefit.

An integer: A type that represents whole numbers.

As said in class, this assignment covers the basic user input (text based) and basic output (print).

I have just edited my article as I realised that I did it wrong. Indeed, first you need to create a program in atom that will allow you to do the operations with whatever number on the apple text editor (the script).

To do the operations you need the operators:

for the sum use +; for difference use -; for the product use *; for the integer based divison use //; for the remainder of integer division use %.

In the first place you need to assign variables to the integers, which are names that refer to some values.

Then you just need to write the expression wanted with the operation and you get the result!

 

Leave a comment