Develop a simple calculator program that reads two positive integer numbers a & b and then prompts
Fantastic news! We've Found the answer you've been seeking!
Question:
Develop a simple calculator program that reads two positive integer numbers a & b and then prompts the user to enter an operation char as follows:
Calculator operations:
Enter A for addition (a+b)
S for subtraction (a-b)
M for multiplication (a*b)
D for division (a/b)
R for remainder (a%b)
F for factorial of the sum of a and b
W for the power of a to b
Q for square root of the product of a and b.
E. for sum of even numbers in range
O. for sum of odd numbers in range
P for sum of prime numbers in range
V for reversing digits of the smaller of a and b (ex: 654 reverses to 456)
X for exit
- Program should keep running until user enters X.
- If the user enters any other code, the program should output a message indicating that character entered is not within the list, then it displays the list again.
- If the user enters a negative number for either a or b, the program should use it’s absolute value
- The program should be structured with at least five value returning functions ( F, E,O,P,V) along with main program
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date: