import java.util.Scanner;
/*
* 某城市出租车计费问题:
每日06:00-21:00,起步价6元,当日22:00-次日05:00,起步价7元。0~23
起步价包含2公里,超出部分按照每公里1.5元收费。
每次乘车加收1元的燃油附加税。
输入打车的时间和距离,计算本次打车的费用。
*/
public class Test12 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int money = 0;
System.out.println("请输入打车时间:(0~23)");
int time =sc.nextInt();
if (time<0 && time>23) {
System.out.println("时间错误");
return;
}
System.out.println("请输入打车路程:");
double distance = sc.nextDouble();
//每次乘车加收1元的燃油附加税。
money += 1;
if (time>= 6&&time <= 21) {
money += 6;
}else{
money += 7;
}
if (distance<=2) {
}else {
money +=(distance-2)*1.5;
}
System.out.println("车费"+money+"元");
}
}