pemrograman sekuensial
Source code
System.out.println("Nama: Syuraini Noor Chamsyah");
System.out.println("NPM: 22082010033");
System.out.println(" ");
System.out.println("Aplikasi Kasir Sederhana");
System.out.println(" ");
System.out.println(" ");
System.out.println("Selamat Datang:)");
System.out.println(" ");
System.out.println(" ");
int hargaberas = 15000;
double diskon= 0.05;
System.out.println("harga beras " +hargaberas+" rupiah per kg" );
System.out.print("masukan berat beras: " );
int beratberas = scan.nextInt();
int total= hargaberas*beratberas;
double bayar= total-(total*diskon);
System.out.println("total harga : " +total+" rupiah");
System.out.println("");
System.out.println("karena mendapatkan diskon 5%");
System.out.println("maka uang yang harus dibayarkan adalah :"+bayar+" rupiah");
System.out.println(" ");
System.out.print("Uang yang dibayarkan: ");
int uangpembeli= scan.nextInt();
double uangpengembalian= uangpembeli-bayar;
System.out.println("Uang pengembalian: "+uangpengembalian+" rupiah");
System.out.println(" ");
System.out.println("Terima Kasih Sudah Berbelanja");
System.out.println(" ");
Komentar
Posting Komentar