Page 1 of 1

Program Requirements: . Write a program that prompts the user to select either a circle, cube/rectangular prism, or sphe

Posted: Tue Jul 05, 2022 10:25 am
by answerhappygod
Program Requirements: . Write a program that prompts the user toselect either a circle, cube/rectangular prism, or sphere.Calculate and display the following based on the selected shape: Cube/Rectangular Prism: Surface Area and Volume.  Circle: Area andCircumference.  Sphere: Surface Area and Volume. This program willbuild upon the requirements, calculations, and code with theaddition of adding the calculations for computing a sphere’ssurface area and volume. The program must have the following: Must print out a “header” to the user displaying information aboutwhat the program does.  Prompt the user to choose a shape andstore their choice as a variable.  Use either “if ‐else”statements or a “switch” statement to evaluate the user’s choiceand then prompt for the necessary dimensions of the selected shape.If the user enters a non‐valid shape display a message saying soand exit the program.  With the entered shapes dimensionscalculate the necessary calculation needed to be displayed based onthe information above.  For the circle and sphere, either promptthe user to enter a radius or randomly generate one.  For thecircle and sphere calculation, Pi, 𝜋, should be utilized with theMath class’s PI constant.  The programs output should neatlydisplay the shapes entered dimensions and the required informationfrom above. Round final calculations to 4 decimal places.