十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
这个应该比较简单的吧。
目前成都创新互联公司已为上1000家的企业提供了网站建设、域名、网站空间、网站托管、服务器租用、企业网站设计、如皋网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。
当用户点击‘退票’之后,你们应该内部有个短信接口,你只需要把客户的信息查询出来,然后作为参数调用相应的接口。
如果没有短信接口,肯定要先购买类似的服务才行。
第一个:
import java.util.Scanner;
/**
* Created by Chen on 2015/11/11.
*/
public class T {
public static void main(String[] args) {
int temp = 0;
Scanner s = new Scanner(System.in);
System.out.print("请输入3个整数");
int a = s.nextInt();
int b = s.nextInt();
int c = s.nextInt();
if (a b) {
temp = a;
a = b;
b = temp;
}
if (a c) {
temp = a;
a = c;
c = temp;
}
if (b c) {
temp = b;
b = c;
c = temp;
}
System.out.println("a的值:" + a + "b的值:" + b + "c的值:" + c);
}
}
第二题:
import java.util.Scanner;
/**
* Created by Chen on 2015/11/11.
*/
public class T {
public static void main(String[] args) {
int temp = 0;
Scanner s = new Scanner(System.in);
System.out.print("输入一个数");
int a = s.nextInt();
if((a%3==0)||(a%5==0))
System.out.println("该整数是3或5的倍数");
else System.out.println("“该数不能被3或5中的任何一个数整除" );
}
}
第三题:
import java.util.Scanner;
/**
* Created by Chen on 2015/11/11.
*/
public class T {
public static void main(String[] args) {
int price = 5000;
Scanner s = new Scanner(System.in);
System.out.print("输入订票月份:");
int month = s.nextInt();
if (month 0 month 13) {
if (month 3 month 11) {
System.out.println("该月车票价格如下:头等舱" + price * 0.9 + "元" + " " + "经济舱" + price * 0.8);
} else System.out.println("该月车票价格如下:头等舱" + price * 0.5 + "元" + " " + "经济舱" + price * 0.4);
} else System.out.println("请输入正确的月份");
}
}
在你的基础上稍稍改动:
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("输入错误");
}
}
}
}
客户通过html提交客户信息表单(比如客户姓名、手机号、预订航班号、时间等)
服务端通过HTTP接收到消息,然后servlet进行用户验证这些业务流程外,还对接收到的表单进行处理并入库。最后通过结果返回给客户相应的html结果。
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,所以无法测试,你自己调试吧。