package balok;
import java.util.Scanner;
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("--------------------------");
System.out.println("0 BALOK 0");
System.out.println("--------------------------");
System.out.print("Panjang : ");
int panjang = input.nextInt();
System.out.print("Lebar : ");
int lebar = input.nextInt();
System.out.print("Tinggi : ");
int tinggi = input.nextInt();
int luas = panjang*lebar;
System.out.println("Luas Permukaan = "+luas);
int volume = panjang*lebar*tinggi;
System.out.println("volume Balok = "+volume);
if (volume <= 300)
{
int total = 1;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 450)
{
int total = 2;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 600)
{
int total = 3;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 750)
{
int total = 4;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 900)
{
int total = 5;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 1050)
{
int total = 6;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 1200)
{
int total = 7;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 1350)
{
int total = 8;
System.out.println("Jumlah Balok = "+total);
}
else if (volume <= 1500)
{
int total = 9;
System.out.println("Jumlah Balok = "+total);
}
else
{
int total = 10;
System.out.println("Jumlah Balok = "+total);
}
System.out.println("--------------------------");
// TODO code application logic here
}
}
No comments:
Post a Comment