Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 15101194S
- //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);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement