Program java :
import javax.swing.JOptionPane;
public class bujursangkar1
{
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=number1*number1;
JOptionPane.showMessageDialog(null,"Luas bujur sangkar adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
import javax.swing.JOptionPane;
public class bujursangkar1
{
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=number1*number1;
JOptionPane.showMessageDialog(null,"Luas bujur sangkar adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
0Awesome Comments!