Kode Program : package bahasa_pemrograman_1; import java.util.*; public class Percabangan_if_else { public static void main(String[] args) { int jumlahbrg,hrgsatuan,totalawal,totalakhir,diskon=0,uang,kembalian; Scanner input = new Scanner(System.in); System.out.println("================================"); System.out.println("Masukkan jumlah barang yang dibeli : "); jumlahbrg = input.nextInt(); System.out.println("================================"); System.out.println("Masukkan harga satuan barang : "); hrgsatuan = input.nextInt(); System.out.println("================================"); totalawal = jumlahbrg*hrgsatuan; System.out.println("================================"); System.out.println("Total Pembelian : "+totalawal); if(totalawal > 100000 && totalawal <= 200000){
Postingan
Menampilkan postingan dari September, 2022
Kasir Warung Beras Sederhana
- Dapatkan link
- X
- Aplikasi Lainnya
Kode Program : package bahasa_pemrograman_1; import java.util.*; public class Bahasa_Pemrograman_1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int jumlahberas,hargaberas,jumlahuang,diskon,totalawal,totalakhir,kembalian; System.out.println("==========================================="); System.out.println("Program Warung Beras Sederhana"); System.out.println("==========================================="); System.out.print("Masukkan jumlah beras yang dibeli (kg) : "); jumlahberas = input.nextInt(); System.out.print("Masukkan harga beras per kg : "); hargaberas = input.nextInt(); totalawal=jumlahberas*hargaberas; diskon=totalawal*5/100; totalakhir=totalawal-diskon; System.out.println("==========================================="); System.out.println(