LA DECIMA
Jumat, 30 Mei 2014
program penjualan (PBO 1)
import java.io.*;
public class distro{
public static void main (String [] rio){
int jawab =0;
int price=0;
int total;
BufferedReader masuk = new BufferedReader(new InputStreamReader (System.in));
try{
while(jawab!=4){
int quantity=0;
String item ="tidak tersedia";
System.out.println();
System.out.println("==================");
System.out.println("CAHIEL DISTRO ");
System.out.println("==================");
System.out.println(" 5. Jacket");
System.out.println(" 6. T-shirt");
System.out.println(" 7. Jeans");
System.out.println(" 8. exit");
System.out.println("==================");
System.out.println();
System.out.print("Choose No. [5 - 8 ] ? ");
try{
jawab = Integer.parseInt(masuk.readLine());
}catch(NumberFormatException angka){
System.out.println("bukan menu yang anda masukkan");
}
if (jawab==5){
item = "Jacket";
price = 210000;
}else if (jawab==6){
item = "T-shirt";
price = 115000;
}else if (jawab==7){
item = "Jeans";
price = 175000;
}else if (jawab==8){
System.exit(0);
}
System.out.println();
System.out.println("Item Order : "+item);
System.out.println("Price / item : "+price);
if (!(item.equalsIgnoreCase("tidak tersedia"))){
System.out.print("Quantity : ");
try{
quantity = Integer.parseInt(masuk.readLine());
}catch(NumberFormatException angk){
System.out.println("masukkan nominal dengan benar");
}
System.out.println("Total Cost : Rp."+(price*quantity));
}
System.out.println("==================");
}
}catch(IOException er){
System.out.println();}
}
}
Label:
java
Langganan:
Posting Komentar (Atom)
CAHIEL STORY
Design Template By cahiel gustyartono
Tidak ada komentar
Posting Komentar