Berikut program kredit source codenya sbb:
======================================
import javax.swing.JOptionPane;
class kredit
{
public static void main(String[] args)throws Exception
{
String nama = JOptionPane.showInputDialog( "Nama : ");
String alamat = JOptionPane.showInputDialog( "Alamat : ");
String namabarang = JOptionPane.showInputDialog( "Nama Barang : ");
String harga = JOptionPane.showInputDialog( "Harga : ");
String kredit = JOptionPane.showInputDialog( "Kredit (bulan) : ");
String dp1 = JOptionPane.showInputDialog( "Down Payment : ");
int hrg = Integer.parseInt(harga);
int krd = Integer.parseInt(kredit);
int dp = Integer.parseInt(dp1);
double tothrg = hrg+(hrg/10);
double tothrgdp = tothrg-dp;
double bulanan = tothrgdp/krd;
JOptionPane.showMessageDialog( null,"===================================== : "+
"\nNama Anda : "+nama+
"\nAlamat Anda : "+alamat+
"\nNama Barang : "+namabarang+
"\nHarga : "+harga+
"\nKredit : "+krd+
"\nDp : "+dp+
"\nTotal Bayar (+ppn 10%) : "+tothrgdp+
"\nCicilan Perbulan : "+Math.round(bulanan)+
"\n===================================== ");
System.exit(0);
}
}
===========================================
berikut hasil tampilannya :
import javax.swing.JOptionPane;
class kredit
{
public static void main(String[] args)throws Exception
{
String nama = JOptionPane.showInputDialog( "Nama : ");
String alamat = JOptionPane.showInputDialog( "Alamat : ");
String namabarang = JOptionPane.showInputDialog( "Nama Barang : ");
String harga = JOptionPane.showInputDialog( "Harga : ");
String kredit = JOptionPane.showInputDialog( "Kredit (bulan) : ");
String dp1 = JOptionPane.showInputDialog( "Down Payment : ");
int hrg = Integer.parseInt(harga);
int krd = Integer.parseInt(kredit);
int dp = Integer.parseInt(dp1);
double tothrg = hrg+(hrg/10);
double tothrgdp = tothrg-dp;
double bulanan = tothrgdp/krd;
JOptionPane.showMessageDialog( null,"===================================== : "+
"\nNama Anda : "+nama+
"\nAlamat Anda : "+alamat+
"\nNama Barang : "+namabarang+
"\nHarga : "+harga+
"\nKredit : "+krd+
"\nDp : "+dp+
"\nTotal Bayar (+ppn 10%) : "+tothrgdp+
"\nCicilan Perbulan : "+Math.round(bulanan)+
"\n===================================== ");
System.exit(0);
}
}
================================================
hasilnya adalah sbb:






Minggu, 21 Juni 2009
Program kredit
Diposting oleh anak sastra daerah di 08.22
Langganan:
Posting Komentar (Atom)


0 komentar:
Posting Komentar