Question: 03. Third Assignment - Menu-Driven Calculator In this assignment, you will modify your basic calculator to be a little more user-friendly. Make these modifications: 1.



03. Third Assignment - Menu-Driven Calculator In this assignment, you will modify your basic calculator to be a little more user-friendly. Make these modifications: 1. If the user enters an invalid menu option, allow them to try again until they enter a valid one. 2. If the user chooses three invalid menu options in a row, give them a message about trying again later and end the program. 3. After the user chooses a valid menu option and your program computes and displays the result, you should start over again by displaying the menu. This should continue until the user chooses a Quit" menu option. Here are some example runs of the program: Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 9 I'm sorry, 9 wasn't one of the options Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? O I'm sorry, o wasn't one of the options Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 9 I'm sorry, 9 wasn't one of the options Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? O I'm sorry, wasn't one of the options Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 1 What is the first number? 3 What is the second number? 4 Answer: 7.0 Menu 1. Add 2. Subtract 3. Multiply 4. Divide Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 6 Goodbye! . . . . You will be graded according to the following rubric (each item is worth one point): The menu is repeatedly displayed until a valid option is entered If the user enters three invalid choices in a row, the program ends If the user enters two invalid choices, then a valid one, then another invalid one, the program does NOT end The program computes the correct answers for each menu option The program continues after a valid operation by re-displaying the menu The program ends when the user chooses the Quit option from the menu The program does not end on division by zero - just display an error message and allow the user to retry The program compiles The program runs You follow standard coding conventions (e.g. variable names, indentation, comments, etc.) Note: If your program does not compile, you will receive a score of 0 on the entire assignment Note: If you program compiles but does not run, you will receive a score of 0 on the entire assignment Note: If your Eclipse project is not exported and uploaded to the eLearn drop box correctly, you will receive a score of 0 on the entire assignment Note: If you do not submit code that solves the problem for this particular . . . . assianment you will not receive any points for the program's compiling the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
