你這給100分都不見的有人給你做了。。。除非有人正好有一樣的。。。
成都創(chuàng)新互聯(lián)是一家專注于網(wǎng)站制作、成都網(wǎng)站制作與策劃設(shè)計(jì),連云網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十載,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:連云等地區(qū)。連云做網(wǎng)站價(jià)格咨詢:18980820575
public class Ticket {
private int month;
private int classLevel; //1: 頭等艙, 2: 經(jīng)濟(jì)艙
private int price;
private int basePrice = 5000; //原價(jià)
public Ticket(int month, int classLevel) {
this.month = month;
this.classLevel = classLevel;
}
public void showMeThePrice() {
//旺季月份: 4-10
if ((month = 4) (month = 10)) {
if (classLevel == 1) {
price = basePrice * 0.9;
System.out.println("Month: " + month + "; Class: " + classLevel + "; Price: " + price);
} else if (classLevel == 2) {
price = basePrice * 0.8;
System.out.println("Month: " + month + "; Class: " + classLevel + "; Price: " + price);
}
}
// 淡季月份: 1,2,3,11,12
if ((month = 1) (month = 3) || month = 11 || month = 12) {
if (classLevel == 1) {
price = basePrice * 0.5;
System.out.println("Month: " + month + "; Class: " + classLevel + "; Price: " + price);
} else if (classLevel == 2) {
price = basePrice * 0.4;
System.out.println("Month: " + month + "; Class: " + classLevel + "; Price: " + price);
}
}
}
}
測試類:
public class Test {
Ticket myTicket = new Ticket(4, 1); //例如:四月,頭等艙
myTicket.showMeThePrice();//輸出顯示價(jià)格
...
}
以上代碼全部手打,因?yàn)楣緵]有安裝jdk,所以無法測試,你自己調(diào)試吧。
客戶通過html提交客戶信息表單(比如客戶姓名、手機(jī)號、預(yù)訂航班號、時間等)
服務(wù)端通過HTTP接收到消息,然后servlet進(jìn)行用戶驗(yàn)證這些業(yè)務(wù)流程外,還對接收到的表單進(jìn)行處理并入庫。最后通過結(jié)果返回給客戶相應(yīng)的html結(jié)果。