Pangil_aku_Andi

Don't Give Up in Life …

Program Belanja


//Program Diskon belanja

import java.util.Scanner;
class belanja
{
public static void main (String[]args)
{
Scanner input = new Scanner(System.in);
int total,jml,uang,kembali;
System.out.println(“”);
System.out.print(“total belanja: “);
total=input.nextInt();
int diskon=0;
if (total >=100000) {
diskon=total/10;
}
jml=total-diskon;
System.out.println(“Total Diskon =”+diskon);
System.out.println(“Harga Yang Di Bayar =”+jml);
System.out.print(“Uang Pembeli = “);
uang=input.nextInt();
kembali=uang-jml;
System.out.println(“”);
System.out.println(“##########################”);
System.out.println(“”);
System.out.println(“Total Kembalian=”+kembali);
System.out.println(“”);
System.out.println(“TERIMA KASIH”);
}
}

// Save dengan format belanja.java

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: