第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

初學(xué)者:滴滴租車系統(tǒng)

標(biāo)簽:
Java

package com.imooc;

public class Bus {
int id;
String name;
String money;
String cap;
public void bus(int id,String name,String money,String cap){

    this.id=id; this.name=name; this.money=money;   this.cap=cap;
    System.out.println(id+"\t"+name+"\t"+money+"\t"+cap);
}

}

package com.imooc;
import java.util.Scanner;
public class Test {

/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println("欢迎使用答答租车系统:");
    System.out.println("您是否要租车:1.是\t0.否");
    while(true){
    Scanner x1=new Scanner(System.in);      
    int x=x1.nextInt();
    if(1==x){
        System.out.println("您可租车的类型及其价格表:");
        System.out.println("序号\t"+"汽车名称\t"+"租金\t"+"容量");
        Bus bus1=new Bus();
        Bus bus2=new Bus();         
        Bus bus3=new Bus();
        bus1.bus(1,"奥迪A4","500元/天","载人:4人");
        bus2.bus(2, "皮卡雪6", "450元/天","载人:4人  载货:2吨");
        bus3.bus(3, "松花江", "400元/天", "4吨");
        System.out.println("请输入你要租车的数量:");
        Scanner y1=new Scanner(System.in);
        int y=y1.nextInt();
        int[] q = new int[y];
        for(int i=0;i<q.length;i++){
            System.out.println("请输入第"+(i+1)+"辆车的序号:");
            Scanner q1=new Scanner(System.in);
            q[i]=q1.nextInt();
        }
        System.out.println("请输入租车天数:");
        Scanner z1=new Scanner(System.in);
        int z=z1.nextInt();
        System.out.println("您的账单如下:");
        int peoples=0;
        int goods=0; 
        int prices=0;
        for(int j=0;j<q.length;j++){
            if(1==q[j]){
                System.out.print("奥迪A4\t");
                peoples+=4;
                prices=z*500+prices;
                }
            else if(2==q[j]){
                System.out.print("皮卡雪6\t");
                peoples+=4; goods+=2;
                prices=z*450+prices;
                }
            else if(3==q[j]){
                System.out.print("松花江\t");      
                goods+=4;
                prices=z*400+prices;
                }       
        }

        System.out.println("\n共载人:"+peoples+"人");
        System.out.println("共载货:"+goods+"吨");
        System.out.println("租车总价格为:"+prices+"元");
        System.out.println("欢迎使用答答租车系统,谢谢再见!");
    }
    else if(0==x)
        System.out.println("谢谢使用,再见!");
    else{
        System.out.println("输入错误!");
        System.out.println("请重新输入:");
        }
    }
}

}

點擊查看更多內(nèi)容
3人點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消