Question: Create a simple calculator. The program should ask the user to: i. enter an even round number limited between [10 30] (eg:12/14/20/38) for first input
Create a simple calculator. The program should ask the user to: Lenter an even round number limited between (10 - 30 (eg:12/14/20/38) for first input value II. an operator which is limited to plus and minus only it, and another even round number as in i) for second input value. It should then carry out the specified arithmetical operation; adding, subtracting multiplying, or dividing the two input values. Use a switch statement to select the operation. Finally, display the result. When it finishes the calculation, the program should ask whether the user wants to do another calculation. The response can be Y' or 'N However, please practice error control. For an example if the user inserts a character/symbols or any number not within range Including odd number (eg 3314.m@) as well as wrong operator (multiply and divide) as inputs, the program will prompt such warning: Wrong inputs. Please insert a proper input. Please also display a clear instruction for user to avoid wrong inputs. Output Example: You have inserted 30 as first input, and 48 as second input. The result of addition between input is 78 Do you want to do another calculation? (Y/N)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
