Page 1 of 1

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

Posted: Tue Jul 12, 2022 8:28 am
by answerhappygod
Program Requirements 85pts Write A Program That Prompts The User To Select Either A Circle Cube Rectangular Prism Or 1
Program Requirements 85pts Write A Program That Prompts The User To Select Either A Circle Cube Rectangular Prism Or 1 (87.78 KiB) Viewed 26 times
Program Requirements: 85pts. Write a program that prompts the user to select 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 and Circumference. - Sphere: Surface Area and Volume. This program will build upon the requirements, calculations, and code that were done within Assignments 1 and 2 with the addition of adding the calculations for computing a sphere's surface area and volume. A three-dimensional geometric surface having all of its points the same distance from a given point. Volume V=34​πr3 Surface area A=4πr2 The program must have the following:
- Must print out a "header" to the user displaying information about what the program does. - Prompt the user to choose a shape and store their choice as a variable. - Use either "if -else" statements or a "switch" statement to evaluate the user's choice and then prompt for the necessary dimensions of the selected shape. If the user enters a non-valid shape display a message saying so and exit the program. - With the entered shapes dimensions calculate the necessary calculation needed to be displayed based on the information above. - For the circle and sphere, either prompt the user to enter a radius or randomly generate one. - For the circle and sphere calculation, Pi, π, should be utilized with the Math class's PI constant. - The programs output should neatly display the shapes entered dimensions and the required information from above. Extra Credit: 5pts. Round final calculations to 4 decimal places.