Kali ini saya akn membagikan tentang mencari volume silindr pada pemrograman java, . .
Selamat mencoba, . .
import java.util.Scanner;
public class VolumeOfCylinder {
public static void main(String[] iriahus) {
final double PI = 3.14159;
@SuppressWarnings("resource")
Scanner s = new Scanner(System.in);
System.out.print("Input radius: ");
double radius = s.nextDouble();
System.out.print("Input length: ");
double length = s.nextDouble();
// Calculates the area and volume of Cylinder
double area = PI * radius * radius;
double volume = area * length;
System.out.println("The Cylinder area is " + area);
System.out.println("The Cylinder volume is " + volume);
}
}
Semoga bermanfaat, . .
0 Response to "Mencari Volume Silinder"
Post a Comment