rumus: panjang * lebar * tinggi
Program java :
import javax.swing.JOptionPane;
public class balok
{
public static void main(String args[])
{
String first;String second;String third;String fourth;int number1;int number2;int number3;int sum;
first=JOptionPane.showInputDialog("Masukkan panjang :");
second=JOptionPane.showInputDialog("Masukkan lebar :");
third=JOptionPane.showInputDialog("Masukkan tinggi :");
number1=Integer.parseInt(first);
number2=Integer.parseInt(second);
number3=Integer.parseInt(third);
sum=number1*number2*number3;
JOptionPane.showMessageDialog(null,"Volume balok adalah : "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
Program java :
import javax.swing.JOptionPane;
public class balok
{
public static void main(String args[])
{
String first;String second;String third;String fourth;int number1;int number2;int number3;int sum;
first=JOptionPane.showInputDialog("Masukkan panjang :");
second=JOptionPane.showInputDialog("Masukkan lebar :");
third=JOptionPane.showInputDialog("Masukkan tinggi :");
number1=Integer.parseInt(first);
number2=Integer.parseInt(second);
number3=Integer.parseInt(third);
sum=number1*number2*number3;
JOptionPane.showMessageDialog(null,"Volume balok adalah : "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
0Awesome Comments!