import java.util.Scanner;
public class parkiran{
public static void main (String[]args){
Scanner input = new Scanner (System.in);
int jam_parkir,b_parkir,kendaraan = 0;
int motor = 2000;
int motor2 = 1000;
int mobil = 3000;
int mobil2 = 2000;
int mbox = 5000;
int mbox2 = 3000;
System.out.println ("==========================");
System.out.println ("||1.Motor\t\t||");
System.out.println ("||2.Mobil\t\t||");
System.out.println ("||3.Truk & Mobil Box\t||");
System.out.println ("==========================");
System.out.print ("Masukkan Jenis Kendaraan: ");
kendaraan = input.nextInt();
if (kendaraan == 1){
System.out.println ("Biaya perjamnya adalah Rp 2000 + 1000 jam berikutnya");
System.out.println ("Lama Parkir");
jam_parkir = input.nextInt();
if (jam_parkir == 1){
b_parkir = motor;
System.out.println ("maka anda harus membayar "+b_parkir);
}
else if (jam_parkir > 1){
b_parkir = jam_parkir * motor2 + motor - 1000;
System.out.println ("maka anda harus membayar "+b_parkir);
}
}
if (kendaraan == 2){
System.out.println ("Biaya perjamnya adalah Rp 3000 + 2000 jam berikutnya");
System.out.println ("Lama Parkir");
jam_parkir = input.nextInt();
if (jam_parkir == 1){
b_parkir = mobil;
}
else if (jam_parkir > 2){
b_parkir = jam_parkir * mobil2 + mobil - 2000;
System.out.println ("maka anda harus membayar "+b_parkir);
}
}
if (kendaraan == 3){
System.out.println ("Biaya perjamnya adalah Rp 5000 + 3000 jam berikutnya");
System.out.println ("Lama Parkir");
jam_parkir = input.nextInt();
if (jam_parkir == 1){
b_parkir = mbox;
}
else if (jam_parkir > 2){
b_parkir = jam_parkir * mbox2 + mbox - 3000;
System.out.println ("maka anda harus membayar "+b_parkir);
}
}
}
}
Tidak ada komentar:
Posting Komentar