java的一道题 希望能帮我一下

2020-10-29 社会 50阅读
float order(month, seatType){
float price = 5000;
int season = (month >= 4 && month <= 10) ? 1 : 2; //1是旺季,2是淡季
switch(season){
case 1:
if(seatType == 1){
return price * 0.9;
}else if(seatType ==2){
return price * 0.8;
}
case 2:
if(seatType == 1){
return price * 0.5;
}else if(seatType ==2){
return price * 0.4;
}
}
return price;
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com