Meong Java


import javax.swing.*;

public class Kucing

{

public static void main(String[] args)

{

String [] b1 = new String [7];

String [] b2 = new String [7];

String output= “”;

int i;

int y;

int n;

for (i=0 ; i<=6 ; i++)

{

b1 [i]=JOptionPane.showInputDialog(null,"nama binatang 1! per hurufnya yaaa");

output += "hewan1 =" +b1[i] +",";

}

output = output.substring(0,output.length()-1);

for (y=0 ; y<=6; y++)

{

b2 [y]=JOptionPane.showInputDialog(null,"nama binatang 2! per hurufnya berurutan yaaa");

output += "hewan2 =" +b2[y] +",";

}

output = output.substring(0,output.length()-1);

if (b1[i].equalsIgnoreCase(b2[y]))

{

output += "SAMA";

}

else

{

output += "TIDAK SAMA";

}

//menampilkan hasil

JTextArea outputArea= new JTextArea( );

outputArea.setText(output);

JOptionPane.showMessageDialog(null,outputArea,"Menyamakan huruf",JOptionPane.INFORMATION_MESSAGE);

//terminasi

System.exit(0);

}

}

One thought on “Meong Java

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s