Question: Using only the techniques and methods taught in CS 1 1 0 , write a C + + program that act as a simple calculator.

Using only the techniques and methods taught in CS110, write a C++ program that
act as a simple calculator. The program must prompt the user to choose an
operation they want to perform by typing in the letter corresponding to the
desired operation: a: Addition, s: Subtraction, d: Division, m: Multiplication, x: Exit
the program. If the user types a different letter, the program should display an
error message. After selecting the desired operation, the program should prompt
the user to enter two numbers of type double, and then perform the arithmetic
operation using the entered numbers.
For instance, if the user enters the letter a (for addition),3 as the first number, and
5.5 as the second number, the program should output the following message:
The addition of 3 and 5.5 is 8.5
Enter a letter (a: Addition, s: Subtraction, d: Division, m: Multiplication, x : Exit):
Hint: Use a loop to control when the user exits the program.
Questions:
What will be the output if the user inputs the letter d,15.6 as the first number,
and 3 as the second number?
What will be the output if the user inputs the letter d,5 as the first number,
and 0 as the second number? Explain why?
 Using only the techniques and methods taught in CS110, write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!