Salju

Sabtu, 16 November 2013

Program Java Penjualan Flashdisk

class penjualan
{
public static void main(String[] args)
{
String input;
int Harga,Flashdisk,Pilihan;
double Diskon,Total;

System.out.print("\n\n *__* PROGRAM WARNET *__* ");
System.out.print("\n\n");

System.out.println("1. Flashdisk : 4  G : Rp. 60.000");
System.out.println("2. Flashdisk : 8  G : Rp. 85.000");
System.out.println("3. Flashdisk : 16 G : Rp. 135.000");


System.out.println("\n\n Silahkan Masukkan Pilihan Anda:");
input=System.console().readLine();
Pilihan=Integer.parseInt(input);

switch(Pilihan)
{
case 1 : System.out.println("1. Flashdisk : 4  G : Rp. 60.000");
System.out.println("\n\n Harga:Rp.60000 \t");
Harga=60000;
break;
case 2 : System.out.println("Flashdisk : 8  G : Rp. 85.000");
System.out.println("\n\n Harga:Rp.85000 \t");
Harga=85000;
break;
case 3:
            System.out.println("Flashdisk : 16 G : Rp. 135.000");
System.out.println("\n\n Harga:Rp.135000 \t");
Harga=135000;
break;
default: System.out.println("Kode Yang Dimasukkan SALAH ");
Harga=0;
break;
}

if((Pilihan<4) && (Pilihan>0))

System.out.println("\n  Masukkan Jumlah Flashdisk \t:");
input=System.console().readLine();
Flashdisk=Integer.parseInt(input);

Total=Flashdisk*Harga;


if(Total>500000)
{
Total= Total - (Total*0.05);
}
else
{
Diskon=Total*1;
}

System.out.println("\nTotal:"+Total);


if((Pilihan==2) || (Pilihan ==3))

System.out.println("Gratis Gantungan");

else

System.out.println("Belum Beruntung");

}
}

Tidak ada komentar:

Posting Komentar