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 menu-driven program using a Switch structure and do-while loop that displays and runs the following menu. Have the program return to the main menu after completing a calculation. Geometry calculator 1. Calculate the Area of a Circle 2. Calculate the Area of a Rectangle 3. Calculate the Area of a Triangle. 4. Quit Enter your choice (1-4) If the user enters a 1 from the main menu the program should ask for the radius of the circle and then display its area. Use the following formula: area=\pi r squared Use 3.14159 for \pi (set as a constant) and the radius of the circle for r. If the user enters a 2 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 3 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 *0.5 If the user enters 4, 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 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!