import java.time.Month;
import java.util.Scanner;
public class Test9 {
public static void main(String[] args) {
//淡季和旺季
//淡季经济舱4折 头等舱5折;旺季经济舱8折,头等舱9折
double money = 5000;
Scanner input = new Scanner(System.in);
System.out.println("请输入你出行的月份1~12");
int month = input.nextInt();
System.out.println("请选择舱位1.头等舱2.经济舱");
int cang=input.nextInt();
if(month <= 0 || month > 12 || cang <=0 || cang >2){//判断输入月份和舱位 月份month 舱位cang
System.err.println("请输入正确月份!\n" + "Please enter the correct month!");//err警告
} else {
//1.判断淡季还是旺季
if (month >= 4 && month <= 10){
//旺季
//2.判断头等舱还是经济舱
if(cang == 1){
//头等舱
money = money*0.9;
}else{
//经济舱
money = money*0.8;
}
} else if((month > 0 && month < 4) || (month > 10 && month < 13)){
//淡季
//2.判断头等舱还是经济舱
if (cang == 1){
//头等舱
money=money*0.5;
} else {
//经济舱
money = money*0.4;
}
}
System.out.println("共需要支付:"+money);
}
}
}