import
javax.swing.*;
public class
uas
{
public static void main (String[]args)
{
int data;
double sewa, total;
String kode;
String
strData=JOptionPane.showInputDialog(null,"Input banyak
data");//menentukan banyak data
String no =
JOptionPane.showInputDialog("No Anggota : ");
String nama =
JOptionPane.showInputDialog("NAMA Anggota : ");
String banyakpinjam =
JOptionPane.showInputDialog("Banyak Pinjam : ");
data=Integer.parseInt(strData);
System.out.println("RENTAL");
System.out.println("==========");
System.out.println("");
total=0;
for(int i=1;i<=data;i++)
{
String
strKode=JOptionPane.showInputDialog(null,"Input Kode Barang");
{
if
(strKode=="AK")
{
System.out.println("Kode=AK Sewa= Rp 2000");
sewa=2000;
System.out.println("=============================");
}
else if(strKode=="BD")
{
System.out.println("Kode=BD Sewa=Rp 2500");
sewa=2500;
System.out.println("=============================");
}
else if (strKode=="SN")
{
System.out.println("Kode=SN Sewa=Rp 3000");
sewa=3000;
System.out.println("=============================");
}
else
{
System.out.println("Kode=AK Sewa= Rp 3000");
sewa=3000;
System.out.println("=============================");
}
}
total=total+sewa;
}
System.out.println("Total Bayar = "+total);
System.out.println("No Anggota:"+no);
System.out.println("Nama Anggota:"+nama);
System.out.println("Banyak
Pinjam:"+banyakpinjam);
System.out.println("Jumlah Bayar:"+total);
}
}
0 komentar:
Posting Komentar