Assignment 3

CS 133u
100 POINTS

DUE announced in class

Purpose: To become familiar with simple expressions and conditional loop statements.

Problem: Modify the program in assignment 2 such that:

You will now add three new math calculations of your choice. Such as, square root, quadratic equation, temperature conversion, etc.  make sure to comply with the rules of mathematics (do not allow div/0 sqrt (negative number), etc.) Let the user be aware of those rules showing instruction on the screen and you will also protect div/0 and sqrt of negative numbers, using control structures.

A sample interaction with your program would be like:

<Always give a nice intro to your program and let the user is aware of what the programs does>

Hi, Welcome to the the Math drill program, you will be given the choice to repeat several math exercises.

Let's first practice some adding:

The limit for the numbers are .....

Enter your first number and press <Enter>:
4

Enter your first number and press <Enter>:
4

Enter your answer and press enter:
8

Great 4 + 4 is 8

or

Sorry 4 + 4 is ? (in case another number was entered)

Would you like to repeat another addition exercise?
y

(..repeat add )

or n

go on to subtraction.

The user will have to try all the mathematical operation before the program quits.

Turn in:

 

  Any questions, please let your instructor know.