rumus: 4 * SISI
Program java :
import javax.swing.JOptionPane;
public class kell_bujursangkar
{
public static void main(String args[])
{
String first;String second;int number1;int number2; int sum;
first=JOptionPane.showInputDialog("Masukkan sisi Bujur sangkar:");
number1=Integer.parseInt(first);
sum=4*number1;
JOptionPane.showMessageDialog(null,"Keliling bujur sangkar adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
import javax.swing.JOptionPane;
public class kell_bujursangkar
{
public static void main(String args[])
{
String first;String second;int number1;int number2; int sum;
first=JOptionPane.showInputDialog("Masukkan sisi Bujur sangkar:");
number1=Integer.parseInt(first);
sum=4*number1;
JOptionPane.showMessageDialog(null,"Keliling bujur sangkar adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
0Awesome Comments!