Question: Lab 4 B: Creating a menu For this lab exercise you are going to create a basic program which will allow the user to make

Lab4B: Creating a menu
For this lab exercise you are going to create a basic program which will allow the user to make a selection from a menu; selecting a different option from the menu should result in a different outcome. For this lab, please use a match statement for all possible options the user may input.
First, welcome the user with the welcome message as shown below, explaining what the program does and what the user is expected to do. Next, have the user input a number; based on the number entered, one of the various transformations must be performed. If the user chooses to exit the program, display "Thank you, goodbye!". If the user attempts to input a number that is not on the menu, display "Invalid option!". Finally, if the user tries to display the reciprocal of 0, display "Cannot divide by 0!".
Hints:
Additive inverse of 5 is -5
Reciprocal of 3 is 13
Sample run #1:
Welcome!
Please input a number: 100
What would you like to do to this number:
Get the additive inverse of the number
Get the reciprocal of the number
Square the number
Cube the number
Lab 4 B: Creating a menu For this lab exercise

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 Programming Questions!