手记

答答租车系统1

package com.imooc;

public class Admin {
public void Type(int[] one,Car[] carcrr){
String smg;
int sum1=0;
for(int i=0;i<one.length;i++){
if(one[i]==1||one[i]==2||one[i]==3){
sum1=sum1+4;
}else if(one[i]==4){
sum1=sum1+20;
}
if(one[i]==1||one[i]==2||one[i]==3||one[i]==4){
smg=carcrr[(one[i]-1)].getCarname();
System.out.print(smg+"\t");
}

    }System.out.println("总载人:"+sum1);
}
public void  Type1(int[] one,Car[] carcrr){
    String smg;
    int sum1=0;
    for(int i=0;i<one.length;i++){
        if(one[i]==3){
            sum1=sum1+2;
        }else if(one[i]==5){
            sum1=sum1+4;
        }else if(one[i]==6){
            sum1=sum1+20;
        }
        if(one[i]==3||one[i]==5||one[i]==6){
            smg=carcrr[(one[i]-1)].getCarname();
            System.out.print(smg+"\t");
        }

    }System.out.println("总载货:"+sum1);
}
public int Sum(int[] one){
    int sum=0;
    for(int i=0;i<one.length;i++){
        switch(one[i]){
            case 1:
                sum=sum+500;break;
            case 2:
                sum=sum+400;break;
            case 3:
                sum=sum+450;break;
            case 4:
                sum=sum+800;break;
            case 5:
                sum=sum+400;break;
            case 6:
                sum=sum+1000;break;
        }
    }return sum;
}

}

0人推荐
随时随地看视频
慕课网APP