Question: Write a simple calculator program with the following specifications: -You should create a menu to advertise the functionality of your code such as; Choose your

Write a simple calculator program with the following specifications:

-You should create a menu to advertise the functionality of your code such as;

Choose your desired function!

1- Addition

2- Subtraction

0- Exit

-Your code should first ask for the function, then the numbers to be operated on.

-Your program should be able to work with floating point numbers

-Your program should loop infinitely until the user asks to quit.

-The result given by the calculator should have 3 decimal places.

-Your calculator should only allow the following operations, in this order; Addition, subtraction, multiplication. Putting any other combination of operations will be severely penalized.

-You should employ the switch - case selective structure!

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!