Question: Write a menu - driven program using a Switch structure and do - while loop that displays and runs the following menu. Have the program
Write a menudriven program using a Switch structure and dowhile loop that displays and runs the following menu. Have the program return to the main menu after completing a calculation. Geometry calculator Calculate the Area of a Circle Calculate the Area of a Rectangle Calculate the Area of a Triangle. Quit Enter your choice If the user enters a from the main menu the program should ask for the radius of the circle and then display its area. Use the following formula: areapi r squared Use for pi set as a constant and the radius of the circle for r If the user enters a from the main menu, the program should ask for the length and width of the rectangle and then calculate and display the rectangle's area. Use the following formula : area length width If the user enters from the main menu the program should ask for the length of the triangle's base and it's height, and then calculate and display its area. Use the following formula : area base height If the user enters the program should end. Set variable data types and name them accordingly. Use indentation, comments, and spacing where they apply. Show the use of newline operator, lines, justification in your output will be a part of your grading and clearing the screen.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
