/*========================================================================
nama file : input data
tanggal : 28 nov 2011
programmer : hendra silaban
deskripsi : -menginput data
========================================================================*/
import javax.swing.JOptionPane;
class Penjumlahan
{
public static void main(String[] args)
{
String A1S;
int A1;
String A2S;
int A2;
String A3S;
int A3;
String A4S;
int A4;
String A5S;
int A5;
//int JUMLAH;
int hasiljumlah;
A1S = JOptionPane.showInputDialog("masukkan nilai A1 = ");
A1 = Integer.parseInt(A1S);
A2S = JOptionPane.showInputDialog("masukkan nilai A2 = ");
A2 = Integer.parseInt(A2S);
A3S = JOptionPane.showInputDialog("masukkan nilai A3 = ");
A3 = Integer.parseInt(A3S);
A4S = JOptionPane.showInputDialog("masukkan nilai A4 = ");
A4 = Integer.parseInt(A4S);
A5S = JOptionPane.showInputDialog("masukkan nilai A5 = ");
A5 = Integer.parseInt(A5S);
hasiljumlah = A1 + A2 + A3 + A4 + A5 ;
JOptionPane.showMessageDialog(null, "maka jumlah bilangan tersebut adalah = " +hasiljumlah);
}
}
Tidak ada komentar:
Posting Komentar