Question: create a main java program that completes all the requirements. Write a program that will calculate volume and total surface area of a close cyllinder



create a main java program that completes all the requirements.
Write a program that will calculate volume and total surface area of a close cyllinder with height h and radius r for the base. The formula for the volume and total surface area is given below. - Volume =2h - Area =2h+22 The radius and height should be of type double and will be prompted for and read from the keyboard. Then use these values to calculate the area and volume. Hint: Use Math.pow() and Math.PI in your calculations. If input radius is 5.2 and 8.1 is the height of the cylinder, then the output should be like this: Volume: 688.1 cubic inches Surface area: 434.5 square inches Display output to 1 decimal place. If variable yourValue is of type double and has a value of 8.124, you can use printf to printf( function output this value to 1 decimal as shown below: Re-write Question \#2 from Lab \#3 using methods. The problem where you Will inp value for radius and height then calculate the surface area and volume of a closed cyllinder. You should have the following four methods as shown below: 1. getDouble () method. - This method will accept a string to be displayed (the prompt) then read a double value which is return to the caller. 2. findArea () method This method will accept 2 values (radius and height in that order) then calculate and return surface area of cyllinder to caller. 3. findVolume () method - This method will accept 2 values (radius and height in that order) then calculate and return volume of cyllinder to caller 4. printinfo() method - A void method will accept 4 values (radius, height, area and volume in that order) then each of the values with appropriate descriptive text. Print values to 2 decimal places. Here is sample output for radius of 5 and height of 5. Enter value for radius: 10 Enter value for height: 5 Circle with radius 10.0 and height 5.0 has area of 942.48 and volume of 1570.80 Your main program should look like this. Make sure to document each method: Parameters received, if any, what it does and it returns. Use /** */ for comments as shown below. Also use @param to describe the parameters and @return to describe what is returned. This will help in automatically generating comments for the method for the web. We will do this later in the course. Here is comment and header line for the method f indArea () 11. /*+ Method to calculate surface area of a cyllinder given the radius 12 and height eparam r of base of cyllinder eparam h is height of cyllinder ereturn the surface area of cyllinder */ public static double findArea(double r, double h ) \{
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
