Question: 1. (In Java) Write static methods for the following publicstaticdoublesphereVolume(doubler) publicstaticdoublesphereSurface(doubler) publicstaticdoublecylinderVolume(doubler,doubleh) publicstaticdoublecylinderSurface(doubler,doubleh) publicstaticdoubleconeVolume(doubler,doubleh) publicstaticdoubleconeSurface(doubler,doubleh) that compute the volume and surface area of a sphere
1. (In Java) Write static methods for the following publicstaticdoublesphereVolume(doubler) publicstaticdoublesphereSurface(doubler) publicstaticdoublecylinderVolume(doubler,doubleh) publicstaticdoublecylinderSurface(doubler,doubleh) publicstaticdoubleconeVolume(doubler,doubleh) publicstaticdoubleconeSurface(doubler,doubleh) that compute the volume and surface area of a sphere with a radius r, a cylinder with a circular base with radius r and height h, and a cone with a circular base with radius r and height h. Place them into a class Geometry. Then write a program that prompts the user for the values of r and h, calls the six methods, and prints the results. Incorporate proper exception handling for all methods as well as the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
