[Solved] SOLVED:Modifying basic calculator

$25

File Name: SOLVED:Modifying_basic_calculator.zip
File Size: 310.86 KB

SKU: [Solved] SOLVED:Modifying basic calculator Category: Tag:
5/5 - (1 vote)

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 Im sorry, 9 wasnt 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? 0 Im sorry, 0 wasnt 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? 7 Im sorry, 7 wasnt one of the options Please try again later. ___________________________________________________________________ Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 9 Im sorry, 9 wasnt 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? 0 Im sorry, 0 wasnt 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 5. Generate random number 6. Quit What would you like to do? 4 What is the first number? 6 What is the second number? 0 Im sorry, you cant divide by zero. Answer: 0.0 Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 4 What is the first number? 6 What is the second number? 2 Answer: 3.0 Menu 1. Add 2. Subtract 3. Multiply 4. Divide 5. Generate random number 6. Quit What would you like to do? 6 Goodbye!

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Modifying basic calculator
$25