Question: Task 4.8: Programming exercise 2 (Need to submit this task with assignment 1) Write the code for a program which does the following: ask the
Task 4.8: Programming exercise 2 (Need to submit this task with assignment 1) Write the code for a program which does the following: ask the user to enter two decimal numbers (you can use double as the type to represent them) fromthe keyboard and stores these numbers in two variables displays a simple menu of three options: 1 for addition, 2 for multiplication, and 3 for division asks the user to select an option from the menu (ie. user enters 1, 2 or 3) using an appropriate control structure, it performs the operation implied by the user's choice on the two input numbers displays the result on the screen repeat this process until the user indicates to the program to stop Compile and run this program testing it an appropriate number of times with carefully selected input values. [Hint:consider using a while loop or a do while loop for this program]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
