CONTOH PROGRAM PENJUALAN SUSU DALAM BAHASA JAVA
PROGRAMNYA :
import java.util.Scanner;
public class penjualan_susu
{
//yogi.king.pratama@blogspot.com
public static void main(String args[])
{
Scanner masuk=new Scanner(System.in);
int jenis,ukuran,total_bayar,banyak_pesanan;
int harga;
System.out.println("Jenis susu");
System.out.println("1.susu
DANCOW");
System.out.println("2.susu
BENDERA");
System.out.println("3.susu SGM");
System.out.print("pilihan anda:");
jenis=masuk.nextInt();
System.out.println("Ukuran kaleng
susu");
System.out.println("1.BESAR");
System.out.println("2.SEDANG");
System.out.println("3.KECIL");
System.out.print("pilihan anda:");
ukuran=masuk.nextInt();
System.out.print("banyak
pesanan:");
banyak_pesanan=masuk.nextInt();
if(jenis==1)
{
if(ukuran==1)
harga=25000;
else
if(ukuran==2)
harga=20000;
else
harga=15000;
}
else
if(jenis==2)
{
if(ukuran==1)
harga=20000;
else
if(ukuran==2)
harga=17500;
else
harga=13500;
}
else if(jenis==3)
{
if(ukuran==1)
harga=22000;
else
if(ukuran==2)
harga=18500;
else
harga=15000;
}
else
{
harga=0;
}
total_bayar=banyak_pesanan * harga;
System.out.println("total belanja
anda:"+total_bayar);
}
}
HASIL
OUTPUT :
gan ada contoh flowchartnya gak?
BalasHapus