资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

java机票订购代码 java游客订购机票

JAVA机票预订题目,学的不好老是不会

1)查询数据库,直接显示

创新互联是一家专业提供息县企业网站建设,专注与成都网站制作、成都网站建设、外贸营销网站建设H5技术、小程序制作等业务。10年已为息县众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

2)查询数据库,当座位状态为空时,可以预定。点击预定,更新座位信息,更新我的预定信息,

3)写好jsp调用self.print

4)不懂什么是以符号形式输出

java编程。订购机票,机票的价格受到季节旺季。淡季影响,而且头等藏跟经济舱的价格也不一同。

public class Ticket {

private int month;

private int classLevel; //1: 头等舱, 2: 经济舱

private int price;

private int basePrice = 5000; //原价

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();//输出显示价格

...

}

以上代码全部手打,因为公司没有安装jdk,所以无法测试,你自己调试吧。

JAVA航空订票系统 急求!!作业!!

你这给100分都不见的有人给你做了。。。除非有人正好有一样的。。。

java编程,机票例题纠正改错,谢谢

在你的基础上稍稍改动:

import java.util.Scanner;

public class JiPiao {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.println("请输入您要出行的月份:");

int YueFen = input.nextInt();

System.out.println("请问您选择头等舱还是经济舱?头等舱输入1,经济舱输入2");

int XuanZe = input.nextInt();

if (XuanZe == 1 || XuanZe == 2) {

} else {

System.out.println("请输入数字1,2");

}

double JiaGe;

if (YueFen = 10 YueFen = 4) {

if (XuanZe == 1) {

JiaGe = 5000 * 0.9;

System.out.println("机票的价格为:" + JiaGe);

} else if (XuanZe == 2) {

JiaGe = 5000 * 0.8;

System.out.println("机票的价格为:" + JiaGe);

} else {

System.out.println("输入错误");

}

} else if (YueFen = 1 YueFen = 3 || YueFen == 11 || YueFen == 12) {

if (XuanZe == 1) {

JiaGe = 5000 * 0.5;

System.out.println("机票的价格为:" + JiaGe);

} else if (XuanZe == 2) {

JiaGe = 5000 * 0.4;

System.out.println("机票的价格为:" + JiaGe);

} else {

System.out.println("输入错误");

}

}

}

}

高仿去哪儿网机票预订javaweb源码

importjava.text.SimpleDateFormat;importjava.util.Date;importjava.util.Scanner;/**********************************停车场管理*authorzhang*2013-12-13********************************/publicclassCarStopManager{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);System.out.println("请入车牌号:");Stringcarno=sc.next();CarStopManagercarStopManager=newCarStopManager();carStopManager.setCarNo(carno);//设置车牌号SimpleDateFormatformat=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");Stringsdate=format.format(newDate());System.out.println("当前时间(入场时间)是:"+sdate); System.out.println("需要开出车场吗?yes/no:");Stringyesno=sc.next();if(yesno.equals("yes")){Stringedate=format.format(newDate());System.out.println("出场时间是:"+edate);//计算方法carManager(2,sdate,edate,carStopManager);}}/***计算方法*/publicstatic voidcarManager(inttype,StringstarTime,StringendTime,CarStopManagercarStopManager){if(type==1){//按月收费System.out.println("如若没有缴纳月费请缴纳800元,如若缴纳将不再提示!");}else{/***一般不会有停车几个月的吧?先不考虑停车几年或者几个月的*/StringsDay=starTime.substring(8,10);//入场日期(天)StringsHour=starTime.substring(11,13);//入场小时StringsMM=starTime.substring(14,16);//入场分钟StringeDay=starTime.substring(8,10);//出场日期(天)StringeHour=endTime.substring(11,13);//出厂小时StringeMM=endTime.substring(14,16);//出厂分钟floatmoney=0;//需缴纳的费用intshour=Integer.parseInt(sHour);intehour=Integer.parseInt(eHour);intsmm=Integer.parseInt(sMM);intemm=Integer.parseInt(eMM);intrehour=0;//停车几个小时if(sDay.equals(eDay)){//同一天 //当天6点到20点之间if((shour=6shour=20)){if(ehour-shour=6){//6个小时之内rehour=(ehour-shour)*60+(emm-smm);//停车多少分钟//需要缴纳的费用前15分钟免费以后每15分钟1.5元money=(rehour/15-15)*1.5f;}else{inthour=ehour-shour-6;//6小时除外剩余小时数rehour=6*60+(emm-smm);//停车多少分钟//前15分钟免费以后每15分钟1.5元超过6小时15分钟2元money=((rehour/15-15)*1.5f)+(hour*60/2); }}}else{//跨天20点到6点之间//todo}System.out.println("您的车牌号是:"+carStopManager.getCarNo()+";\n"+"您此次停车花费的费用是:"+money+"元");}}/***bean属性*/privateStringcarNo;//车牌号privateStringstartTime;//入场时间privateStringendTime;//出场时间/***无参构造*/publicCarStopManager(){super();}/***有参数构造*@paramcarNo*@paramstartTime*@paramendTime*/publicCarStopManager(StringcarNo,StringstartTime,StringendTime){super();this.carNo=carNo;this.startTime=startTime;this.endTime=endTime;}/***设置get方法*@return*/publicStringgetCarNo(){returncarNo;} /** *设置set方法 *@paramcarNo */publicvoidsetCarNo(StringcarNo){this.carNo=carNo;}publicStringgetStartTime(){returnstartTime;}publicvoidsetStartTime(StringstartTime){this.startTime=startTime;}publicStringgetEndTime(){returnendTime;}publicvoidsetEndTime(StringendTime){this.endTime=endTime;}}

Java,飞机订票系统

链接:v(括号里不是链接)iew-so(括号里不是链接)(括号里不是链接)urce:ht(括号里不是链接)tp://(括号里不是链接)ww(括号里不是链接)w.a(括号里不是链接)irch(括号里不是链接)ina(括号里不是链接).co(括号里不是链接)m.cn(括号里不是链接)/?ci(括号里不是链接)d=(括号里不是链接)GN-buy(括号里不是链接):20130221:SEM:Baidu:CHN:00(括号里不是链接)0120|fc=(括号里不是链接)k91(括号里不是链接)8988499.a151793471.u933021.pb


分享题目:java机票订购代码 java游客订购机票
文章地址:http://cdkjz.cn/article/dooghis.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220