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 CS 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 as the first number, and
as the second number, the program should output the following message:
The addition of and is
Enter a letter a: Addition, s: Subtraction, d: Division, m: Multiplication, : 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 as the first number,
and as the second number?
What will be the output if the user inputs the letter as the first number,
and as the second number? Explain why?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
