import java.io.*;
public class Nilaibarang
{
public static void main (String [] args)
{
String ket,pre;
int total,diskon,totalKeseluruhan;
try {
{
BufferedReader NilaiA=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Masukan Nama Barang= ");
String input1=NilaiA.readLine();
BufferedReader NilaiB=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Banyaknya Barang= ");
String input2=NilaiB.readLine();
int B=Integer.parseInt(input2);
BufferedReader NilaiC=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Harga= ");
String input3=NilaiC.readLine();
int C=Integer.parseInt(input3);
BufferedReader Quality =new BufferedReader (new InputStreamReader (System.in));
System.out.println("Quality = ");
String input4=Quality.readLine ();
int D=Integer.parseInt(input4);
if ((Q>=1) && (Q <10 ))
{
diskon = (hrg*byk)*0;
total =hrg*byk;
totalJumlah =total-diskon;
ket="Tidak dapat discount";
pre="jelek";
}
else
if ((nilai>=10) && (nilai <=19 ))
{
diskon = (hrg*byk)*2/100;
total =hrg*byk;
totalJumlah =total-diskon;
ket="Discount 2 %";
pre="Lumayan";
}
else
if ((Q>=20) && (Q <=29 ))
{
diskon = (hrg*byk)*5/100;
total =hrg*byk;
totalJumlah =total-diskon;
ket="Discount 5%";
pre="Cukup";
}
else
if ((Q>=30) && (Q <=49 ))
{
diskon = (hrg*byk)*10/100;
total =hrg*byk;
totalJumlah =total-diskon;
ket="Discount 10%";
pre="Baik";
}
else
if ((Q>=50) && (Q <=100 ))
{
diskon = (hrg*byk)*20/100;
total =hrg*byk;
totalJumlah =total-diskon;
ket="Discount 20%";
pre="Sangat Baik";
}
System.out.println("");
System.out.println("NAMA BARANG : "+NilaiA);
System.out.println("HARGA BARANG : "+C);
System.out.println("BANYAKNYA BARANG : "+B);
System.out.println("KUALITAS : "+pre);
System.out.println("KETERANGAN : "+ket);
System.out.println("===============");
System.out.println("TOTAL YANG HARUS ANDA BAYAR ADALAH : RP. "+tj);
}
catch (Exception e)
{
e.printStackTrace();
} // end try
}
}
Categories:
java