//Import Scanner import java.util.Scanner; public class CylinderCal { public static void main(String[] args) { //Scanner Scanner sc = new Scanner(System.in); System.out.print("Please enter the radius: "); //insert radius double Radius = sc.nextDouble(); System.out.print("Please enter the height: "); //insert height double Height = sc.nextDouble(); //Surface Area double Result1 = 2 * Math.PI * Radius * Height; System.out.println("The surface area is " + Result1); //Volume double RadiusSquare = Radius * Radius; double Result2 = Math.PI * RadiusSquare * Height; System.out.println("The Volume is " + Result2); } }
Subscribe to:
Post Comments (Atom)
If the answers is incorrect or not given, you can answer the above question in the comment box. If the answers is incorrect or not given, you can answer the above question in the comment box.