This lab will help you practice with data types, mathematical calculations, input, output, and forming a main program.
Write a program that reads in two numeric values from the user. After you've retrieved the two values, perform mathmatical operations on them — add, multiply, divide, substract — storing the results. Finally report the answers in a nice readable fashion.
As an example, you might have the program interaction look something like (the parts in this color are typed by the user):
$ ./math.out
Welcome to the Math Calculation Program!!!
Please enter your two numbers: 12 42
Thank you!! You've entered 12 and 42! Calculating...
Done.
12 + 42 = 54
12 - 42 = -30
12 * 42 = 504
12 / 42 = 0.285714
Thank you for using the MCP!!
Endeavor to have a advantageous day!
$
How many cin statements do you need in this program?
Should the welcome and the enter be printed from the same cout statement?
What happens if the user types their numbers on separate lines (instead of simply separated by spacing as in the example)?
Obviously if your variables for the user's numbers are float or double, the division answer will have decimal places. Can you still get a floating point answer even if you were using whole valued variables for the user's numbers?
How many variables do you need for this program? At a minimum? At most?
What happens if the user's values are of different signs? Both negative? In descending order? The same?
What happens if the user's first value is a 0? Their second value?
This assignment would be (Level 0).