Write a program called Cylinder.java that calculates the volume of a cylinder. Your program should have a a static function named computeCylinderVolume . This function should accept both radius and...


Write a program calledCylinder.javathat calculates the volume of a cylinder. Your program should have a a static function namedcomputeCylinderVolume .This function should accept both radius and height as doubles and should return the computed volume as a double.



The formula for the volume of a cylinder is given by:


V= π*r2*h


Prompt the user to input two doubles, one for a cylinders height and one for its radius. Then display the result.


(Do not print to console incomputeCylinderVolume)


The output is pictured below. The code must have the static function named computeCylinderVolume in it. Thanks


Super@WUDOL MINGW64 ~/Desktop/cse1001/1lab22<br>$ java Cylinder.java<br>Enter radius of cylinder: 1.0<br>Enter height of cylinder: 1.0<br>Volume = 3.141592653589793<br>Super@WUDOL MINGW64 ~/Desktop/cse1001/1lab22<br>$ java Cylinder.java<br>Enter radius of cylinder: 10<br>Enter height of cylinder: 2<br>Volume = 628.3185307179587<br>%3D<br>

Extracted text: Super@WUDOL MINGW64 ~/Desktop/cse1001/1lab22 $ java Cylinder.java Enter radius of cylinder: 1.0 Enter height of cylinder: 1.0 Volume = 3.141592653589793 Super@WUDOL MINGW64 ~/Desktop/cse1001/1lab22 $ java Cylinder.java Enter radius of cylinder: 10 Enter height of cylinder: 2 Volume = 628.3185307179587 %3D

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here