create a new file in c++. In this lab, you will add some more functionality to the program. Use loops to keep running the program until the user chooses the exit condition (X or x). When dividing, use...


create a new file in c++.


In this lab, you will add some more functionality to the program. Use loops to keep running the program until the user chooses the exit condition (X or x). When dividing, use a loop to validate user input, making sure the denominator (second number) is not zero. If the user enters a 0 for the second number, display an error message and ask them again.


A)   Add two numbers
B)   Subtract two numbers
C)   Multiply two numbers
D)   Divide two numbers
X)   Exit program


The program should:



  • display a "hello" message before presenting the menu

  • display the menu

  • prompt user for selection

    • accept either uppercase or lowercase for selection

    • display error message if invalid selection is made (example: E)



  • display the selection back to the user

  • prompt for two numbers

  • perform the operation and display the results

    • use loop for input validation of second number during division

    • display error message for division when second number is 0



  • after displaying result, use loop to present menu again and ask for another selection

    • do not display "hello" message again



  • display a "goodbye" message before exiting the program



Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here