package com.imooc;
import java.util.Scanner;
public class Initail {
public void uo(){
class Initai{
public void ip(){
System.out.println("方法内部类执行了");
}
}
Initai hai=new Initai();
hai.ip();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in) ;
Scanner impor=new Scanner(System.in);
Scanner ips=new Scanner(System.in);
System.out.println("******欢迎使用哒哒租车系统********");
System.out.println(" 输入 1 是进入哒哒系统选车");
System.out.println(" 输入 0 是退出");
System.out.println("*****请输入密码****");
int score=input.nextInt();
switch(score){
case 0:
System.out.println("再见");
break;
default:
System.out.println("输入错误程序结束");
break;
case 1:
System.out.println("输入正确");
System.out.println("请选择车辆号码");
System.out.println("货车请输入1 200元一天");
System.out.println("客车请输入2 300元一天");
System.out.println("皮卡请输入3 400元一天");
System.out.println();
System.out.println("想查看详细信息请输入以上的代码编号");
System.out.println("****请正确输入****");
Initail iq=new Initail();
iq.uo();
int scores=impor.nextInt();
if(scores==3){
bus2 hello=new name3();
hello.show2();
hello.show3();
}else if(scores==1){
bus2 hello2=new name1();
hello2.show2();
hello2.show3();
}else if(scores==2){
bus2 hello3=new name2();
hello3.show2();
hello3.show3();
}else{
System.out.println("输入错误程序结束");
break;
}
System.out.println();
System.out.println("请问想要购买多少天?");
int asc=ips.nextInt();
if(scores==1){
bus2 hi=new name1();
hi.show(asc);
break;
}else if(scores==2){
bus2 hi=new name2();
hi.show(asc);
System.out.println();
break;
}else if(scores==3){
bus2 hi=new name3();
hi.show(asc);
break;
}else{
System.out.println("输入错误程序结束");
break;
}
}
System.out.println("程序结束");
}
}
//
package com.imooc;//皮卡
public class name3 extends bus2 {
@Override
public void show2() {
// TODO Auto-generated method stub
System.out.println("皮卡能载货5吨载人4个");
}
@Override
public void show3() {
// TODO Auto-generated method stub
System.out.println("皮卡既有载人的能力又有载货的能力");
}
public void show(double as) {
// TODO Auto-generated method stub
int si=400;
System.out.println("一共是"+si*as+"人民币");
}
}
package com.imooc;//客车
public class name2 extends bus2{
@Override
public void show2() {
// TODO Auto-generated method stub
System.out.println("客车能载人40人");
}
@Override
public void show3() {
// TODO Auto-generated method stub
System.out.println("客车具有载人的能力");
}
public void show(double as) {
// TODO Auto-generated method stub
int sh=300;
System.out.println("一共是"+sh*as+"人民币");
}
}
package com.imooc;//这个是货车
public class name1 extends bus2 {
@Override
public void show2() {
// TODO Auto-generated method stub
System.out.println("货车载货10吨");
}
@Override
public void show3() {
// TODO Auto-generated method stub
System.out.println("没有载人的能力");
}
public void show(double as) {
// TODO Auto-generated method stub
int poss=200;
System.out.println("一共是"+poss*as+"人民币");
}
}
package com.imooc;
public abstract class bus2 {
public Object show;
public abstract void show2();//汽车的类型
public abstract void show3();//载客量或者拉货量
public void show(double asc) {
// TODO Auto-generated method stub
}
}