Source Code :
public class Diskon{
public static void main (String [] args){
int kode, harga, total;
String jenis;
String Diskon;
System.out.println();
System.out.print("KODE : ");
kode = Integer.parseInt(System.console().readLine());
System.out.print("JENIS [ A, B, C, D ]: ");
jenis = System.console().readLine();
System.out.print("HARGA : ");
harga = Integer.parseInt(System.console().readLine());
if(jenis.toUpperCase().equals("A"))
{
total = harga-(harga * 10 / 100);
Diskon = "10%";
}
else if(jenis.toUpperCase().equals("B"))
{
total = harga-(harga * 15 / 100);
Diskon = "15%";
}
else if(jenis.toUpperCase().equals("C"))
{
total = harga-(harga * 20 / 100);
Diskon = "20%";
}
else if(jenis.toUpperCase().equals("D"))
{
total = harga-(harga * 25 / 100);
Diskon = "25%";
}
else
{
total = 0;
Diskon = "0%";
}
System.out.println();
System.out.print("Jenis barang " + jenis.toUpperCase());
System.out.print(" Mendapatkan diskon = " + Diskon);
System.out.print(" Harga setelah didiskon " + total);
System.out.println();
}
}
Outputnya :
Wednesday, April 24, 2013
Discont Barang
Silahkan Copas Gannnn,,,,
Tapi Tolong Jangan Lupa Komentarnya yy gann,,,
0 comments:
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))
Post a Comment