Question: Write a calculator that will give the user the following menu options: 1) Add 2) Subtract 3) Multiply 4) Divide 5) Exit Your program should

Write a calculator that will give the user the following menu options:

 
 

1) Add

 

2) Subtract

 

3) Multiply

 

4) Divide

 

5) Exit

Your program should continue asking until the user chooses 5. If user chooses to exit give a goodbye message. After the user selections options 1 - 4, prompt the user for two numbers. Perform the requested mathematical operation on those two numbers. Round the result to 1 decimal place.

Example 1:

 
 

Let's calculate!

 

1) Add

 

2) Subtract

 

3) Multiply

 

4) Divide

 

5) Exit

 

Please select one of options above: 4

 

Enter the first number: 2.81

 

Enter the second number: 1.111

 

Answer: 3.1

 

1) Add

 

2) Subtract

 

3) Multiply

 

4) Divide

 

5) Exit

 

Please select one of options above: 5

 

Have a good day!

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!