import java.util.Scanner;
public class Test1
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
double price=5000;// 默认票价
System.out.println("请输入要出行的月份");
int month=input.nextInt();
System.out.println("请问您选择头等舱还是经济舱1.头等舱,2.经济舱");
int storehouse=input.nextInt();
lable:
switch (month)
{
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
if(storehouse==1)
{
price=price*0.9;
}else {
price=price*0.8;
}
break lable;
default:
if(storehouse==1)
{
price=price*0.5;
}else {
price=price*0.4;
}
break;
}
System.out.println("您的机票价格为"+price);
}
}