You are on page 1of 1

import java.util.

Scanner;

public class Tugas1 {

public static void main(String[] args) {


Scanner input = new Scanner(System.in);
int harga, jumlah, total = 0;
int potongan1, potongan2, potongan3;

System.out.print("Masukkan Harga Barang : Rp ");


harga = input.nextInt();
System.out.print ("Jumlah Barang : ");
jumlah = input.nextInt();
total = harga*jumlah;
System.out.println("Total Bayar : Rp "+ total);
potongan1 = (total -((total*0)/100));
potongan2 = (total -((total*10)/100));
potongan3 = (total -((total*15)/100));

if(total >= 1000000) {


System.out.println("Total Bayar (Diskon 10%) : Rp "+
potongan3);
}else if(total >= 501000){
System.out.println("Total Bayar (Diskon 5%) : Rp "+
potongan2);
}else if(total < 501000){
System.out.println("Total Bayar : Rp "+ potongan1);
}
{

}
}

You might also like