Twentythree Zone

/*test java program penjualan barang.
*/
import java.io.*;
public class penjualanbarang
                 {

public static void main (String args [])
                   {

try
                  {


BufferedReader namabarang= new BufferedReader (new InputStreamReader(System.in));
System.out.print("Masukan Nama Barang        = ");
String input = namabarang.readLine();

BufferedReader Jumlah= new BufferedReader (new InputStreamReader(System.in));
System.out.print("Masukan Jumlah barang      = ");
String input1=Jumlah.readLine();
int J = Integer.parseInt(input1);

BufferedReader Harga= new BufferedReader (new InputStreamReader(System.in));
System.out.print("Masukan Harga Barang       = ");
String input2=Harga.readLine();
int H = Integer.parseInt(input2);


int UM=20, DS=5,PTG=10,DP=0,Sisabayar=0,Totalharga=0,Bunga=0,Total=0,Sisa=0,S=0;

Totalharga = H*J;
DP = Totalharga * UM/100;

Sisabayar=Sisa + Bunga;

if (Totalharga > 500000){
Bunga = Totalharga * PTG / 100;
Total = Totalharga - Bunga;
System.out.println("anda Mendapatkan Diskon 10 %");

}
                         else
                         {
Total = Totalharga;
}
System.out.println("Total Belanja = "+Total);
System.out.println("Anda dapat melakukan beberapa kali pembayaran dengan DP minimal 20%");

BufferedReader Bayar= new BufferedReader (new InputStreamReader(System.in));
System.out.print("Bayar = ");
String input5=Bayar.readLine();
int B = Integer.parseInt(input5);

Sisa = Total - B;
Bunga= (Sisa * 5)/100;
S =   Sisa + Bunga;
System.out.print("    ");
System.out.println("Sisa yang Harus di Bayar = "+S);
System.out.print("=================================="
System.out.println("Terima Kasih atas Kunjungan Anda");
}
                         catch(IOException e)
                         {
e.printStackTrace();
}

         }
                    }


Categories:

Leave a Reply