9. Write a program that displays the following menu: Geometry calculator 1- Calculate the area of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Python Geometry calculator printGeometry calculator print1 Calculate the area of a Circle print2 Calculate the area of a Square print3 Quit printEnter ... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these computer network questions
-
In the given 4-1 multiplexer if c1=1 and c0=0 then the output M is
-
The following are trial balance of Clarissa Amanda Sdn. Bhd. as at 31st December 2021. Debit RM Credit RM Opening stock, 1 Jan 2021 16,000 Purchases 75,000 Sales return 5,000 Carriage inwards 1,500...
-
Larner Corporation is a diversified manufacturer of industrial goods. The company's activity-based costing system contains the following six activity cost pools and activity rates: Activity Cost Pool...
-
A strain relaxation test and a creep test are being conducted on a mouse Achilles tendon. If a strain of \epsi 0 = 60% is applied in the strain relaxation test and a stress of \ sigma 0 = 1 MPa is...
-
Alex is 31 years old and has lived in Los Alamos, New Mexico, for the last four years where he works at the Los Alamos National Laboratory (LANL). LANL provides employees with a 401(k) plan and for...
-
On what criteria should auditors select the source code to be examined during program source code review?
-
Northwest Hospital's Radiology Department is considering replacing an old inefficient X-ray machine with a state-of-the-art digital X-ray machine. The new machine would provide higher quality X-rays...
-
The Leslie Independent School District (LISD) services all of its long-term debt through a single Debt Service Fund. The LISD DSF balance sheet at December 31, 20X4, appeared as follows: The...
-
9033228 D 80 6 T 10 Ope 3. Suppose you take out a $351,980 mortgage at 12.3% interest compounded annually. How much interest will you have paid after 20 years? /3 4. What is the total amount owed...
-
A cascade system is composed of two ideal refrigeration cycles, as shown in Fig. 9.28. The high temperature cycle uses R-410a. Saturated liquid leaves the condenser at 40C, and saturated vapor leaves...
-
Explain why the stages of negotiation may not always occur in a linear fashion, and that it may be necessary to go back and forth between stages or skip a stage entirely in order to reach a...
-
Mason (single) is a 50 percent shareholder in Angels Corporation (an S Corporation). Mason receives a $191,000 salary working full time for Angels Corporation. Angels Corporation reported $444,000 of...
-
What does it mean to recognize Canadian women and minorities in nation-building, nationhood, and nationalism? How does this help us imagine a new community?
-
At the same moment from the top of a building 3.0 x 102 m tall, one rock is dropped and one is thrown downward with an initial velocity of 28 m/s. Both of them experience negligible air resistance....
-
Use E= 200 GPa and v= 0.32 to calculate Er Eyys Yxys & and o(a) assuming plane stress and (b) assuming plane strain for the following stresses at a point: 5) kan mi Oyy = 150 MPa(T) 6xx = 100 MPa(T)...
-
Discuss a timeline for the strategic and operational controls and assign responsibilities for each of them (board of directors, managers, and employees). Strategic controls are intended to steer the...
-
or Final Exam K < Question 25 of 150 > This test: 150 point(s) possible This question: 1 point(s) possible Resu Collaborative planning, forecasting, and replenishment systems perform many necessary...
-
Bonus shares can be issued out of revenue reserves. True/False?
-
True or False: Java does not allow a statement to use a subscript that is outside the range of valid subscripts for an array.
-
This is a method that stores a value in a field or in some other way changes the value of a field. a. Accessor b. Constructor c. Void d. Mutator
-
Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following: The number of characters in the...
-
Tektronix, Inc., an Oregon-based MNE, manufactures scientific instruments. Jerry Davies, Treasurer, needs to choose an instrument to hedge a \( 2,000,000\) sale to Siemens in Germany, with payment...
-
Call Options on British Pounds (Option.xls) The set of assumptions used throughout the second half of this chapter assumed a spot rate of \(\$ 1.70 / \), a 90 -day maturity, U.S. dollar and British...
-
Jos Ballini is a currency trader and speculator for Bozano Simonsen, one of the largest investment banking firms in So Paulo. The current spot rate is \(\mathrm{R} \$ 1.7800 / \$\), and the 360 -day...
Study smarter with the SolutionInn App