import java.io.*;
public class kodebrg{
public static void main(String Arg[])throws IOException{
String Nama,str;String Kode;
double Hrg=0;double TotalHarga=0, Jumlah;
int Kdbrg;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Kode :");Kode=Get.readLine();
System.out.print("Jumlah :");str=Get.readLine();
Kdbrg=Integer.parseInt(Kode);
Jumlah=Integer.parseInt(str);
if(Kdbrg==1){
Nama="Televisi";Hrg=1750000;
}else if(Kdbrg==2){
Nama="DVD";Hrg=750000;
}else if(Kdbrg==3){
Nama="CDRoom";Hrg=450000;
}else{
Nama="";Hrg=0;
}
TotalHarga=Hrg*Jumlah;
System.out.println("Nama :"+Nama);
System.out.println("Hrg:"+Hrg);
System.out.println("TotalHarga:"+TotalHarga);
}
}
hasilnya:
Tidak ada komentar:
Posting Komentar