Prog 1 Final Exam Batch 1
Simple
Calculator
Create
a program that will have actions as a simple Calculator. It should display a
menu
Welcome to My Calculator
Enter first the operation
A – Addition
S – Subtraction
M – Multiplication
D – Division
Q – Square
C –Cubed
E – Exit
Enter you choice:
If the
user enters either, A, S, M or D, the program should again ask for two values
to enter.
Enter first value:
Enter second value:
Then
it will display the sum, difference, product or quotient.
If the
user enters either Q or C, the program should again ask the user to enter only
one value
Enter
a value:
Then
it will display either squared valued or cubed value.
In the menu, if the
user enters E, the program should print “Thank
you for using My Calculator.” And automatically exit the whole program
0 comments:
Post a Comment