Question: 9. Write a program that displays the following menu: Geometry calculator 1- Calculate the area of a Circle 2- Calculate the area of a
9. Write a program that displays the following menu: Geometry calculator 1- Calculate the area of a Circle 2- Calculate the area of a Square 3- Quit Enter your choice (1-3): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula: area = nr where r is the radius and x = 3.14159. If the user enters 2, the program should ask for the length of the square side and then display its area. If the user enters 3, the program should end. Display an error message if the user enters a number outside the menu. 10. The force of gravity is different for each planet of the nine planets in our solar system. For example, on Pluto, it is only 0.05 times as strong as on Earth. Thus, if you weight 100 pounds (on Earth), you should weight only 5 pounds on Pluto. Write a C++ program that allows you to enter your earth weight and your choice planet to which you would like your weight converted. The output should be your weight on the desired planet together with the planet name. The following table shows the relative forces for gravity for five planets: Force of Gravity 1.00 2.65 0.38 1.23 Planet Earth Jupiter Mercury Neptune Note: The program should accept both lower and upper case letters for the input planet selection (e.g. E or e for earth). If user inputs invalid choice, an error message should be displayed.
Step by Step Solution
There are 3 Steps involved in it
Python Geometry calculator printGeometry calculator print1 Calculate the area of a Circle print2 Calculate the area of a Square print3 Quit printEnter ... View full answer
Get step-by-step solutions from verified subject matter experts
