- 4
- 0
- 约1.79千字
- 约 9页
- 2021-09-26 发布于山东
- 举报
java汽车租赁系统
java汽车租赁系统
PAGE / NUMPAGES
java汽车租赁系统
package RentCar;
public class Bus extends MotoVehicle{
private int seatCount ;
quals(getBrand())){
rent = days * 500;
} else if ( 丰田 .equals(getBrand())){ if ( GL8)){
rent = days * 600;
} else {
rent = days * 300;
}
}
return rent;
}
}
package RentCar;
public class Customer {
private String name;
public Customer(){
}
public Customer(String name){
= name;
}
public String getName(){
return name;
}
public int calcTotalRent(MotoVehicle[] moto, int days){
int rent = 0 ;
for ( int i = 0 ;i ; i++){
if (moto[i]!= null ){
rent = rent + moto[i].calRent(days);
}
}
return rent;
}
}
package RentCar;
public abstract class MotoVehicle {
private String no; 2. );
motoType = ();
int random = ( int )()*(99999-10000)+10000);
switch (motoType){
case 1:
no = 粤A + random;
马 2.
丰田): );
if () == 1){
brand =
宝马;
type =
320i ;
} else {
brand =
丰田;
type =
RAV4;
}
海 2. 金龙): );
根据选择得到汽车品牌
if () ==1){
brand = 黄海 ;
} else {
brand = 金龙 ;
}
请输入客车的座位数: );
seat = (); // 汽车座位数
// 实例化一个轿车对象 , 并添加到 moto数组中
for ( int i = 0 ; i ;i ++){
if (moto[i] == null ){
moto[i] = new Bus(no,brand,seat); // 实例
化一个汽车对象
break ;
}
}
break ;
}
是否继续租车( y/n ): ); answer = ();
} while ( y ));
汽车牌号 \t 汽车品牌 );
for ( int i = 0 ; i ;i ++){
if (moto[i] != null ){
if (moto[i] instanceof Car){
Car c = (Car)moto[i];
\t +());
} else {
Bus b = (Bus)moto[i];
\t +());
}
}
}
+()+ , +days+, +(moto,
days));
}
}
package RentCar;
public class Truck extends MotoVehicle {
private int weight ; //
public Truck(){
}
public Truck(String no, String brand, int weight){
super (no,brand);
= weight;
}
public int getWeight(){
return weight ;
}
public int calRent( int days){
int rent = 0;
rent = weight * 50 * days;
return rent;
}
}
您可能关注的文档
最近下载
- 图案变化与统一课件设计.pptx VIP
- 2025年金融风险管理师买入看跌期权与卖出看跌期权策略专题试卷及解析.pdf VIP
- 2025年拍卖师拍卖谈判中的谈判记录与总结技巧专题试卷及解析.pdf VIP
- 2025年房地产经纪人客户隐私保护监管政策解读专题试卷及解析.pdf VIP
- 基于单片机的数控直流稳压电源的设计.docx VIP
- 县域消费扶贫与长效帮扶机制分析.pdf VIP
- 2025年项目管理专业项目交付成果验收检查表编制专题试卷及解析.pdf VIP
- 煤矿露天改扩建项目竣工验收报告.docx
- 人体解剖学复习测试有答案(二).doc VIP
- 基于stm32的智能小车设计毕业设计论文.docx VIP
原创力文档

文档评论(0)