题目内容

阅读下列说明、图和Java代码,将应填入(n)处的字句写在对应栏内。
【说明】
已知对某载客车辆(Car)进行类建模,如图7-1所示,其中类Engine表示发动机引擎,类Wheel表示车轮,类Body表示车身,类Driver表示司机,类Passenger表示乘客。
【Java代码】
class Body{ //此处代码省略 ); //车身类
class Passenger{ //此处代码省略 )/ //乘客类
class Wheel{ //此处代码省略 ); //车轮类
class Driver{ //司机类
public String name; //表示第几路公交车司机
public Driver(String driverName){name = driverName/) //构造函数
};
class Engine{//引擎类
public String engineNo;//引擎编号
public Engine(String engineNo){this.engineNo=engineNo;)//构造函数
};
public class Car{//汽车类
static final int(1)=7; //定义最多载客数
static final int MAX WHEELS =5; //定义最多轮胎数
protected Engine engine;
protected Driver driver;
protected Body body=new Body();
protected Wheel[] wheels;
protected Passenger[]passengers;
public Car(Driver driver){ //构造函数
(2).driver=driver;
engine=new Engine("TX6536型号引擎");
wheels=new Wheel[MAX WHEELS];
passengers=new Passenger[MAX_PASSENGERS];
for(int index=0;index<MAX_WHEELS;index++){
wheels[index]=new Wheel();
}
for(int index=0;index<MAX_PASSENGERS;index++){
passengers[index]=null;
}
}
int getPassengerNumber(){//获取车上乘客数量
//此处代码省略
}
void getOnPassenger(Passenger aPassenger){//乘客上车
//此处代码省略
}
void run(){ //开车
if((3)){System.out.println("司机尚未上车!");return;}
//此处代码省略
}
public static void main(String args[]){
Driver driver=new Driver("第五路公交车司机");
Car car=new Car((4));
for (int index = 0 ; index < MAX_PASSENGERS; index ++)
car.getOnPassenger((5) Passenger());
car.run();
}
}

查看答案
更多问题

During the traditional wedding ceremony, the bridal couple
promises each other lifelong devotion. Yet, about one out of four【M1】______
American marriages ends in divorce. Since 1940, the divorce rate has
more than doubled, and experts predict that, of all marriages that occured 【M2】______
in the 1970s, about 50% will end in divorce. The USA is one of the 【M3】______
highest divorce rates in the world, perhaps even the highest.
What goes wrong? That fact that divorce is so common in the
United States does not mean that Americans consider marriage a
casual, unimportant relationship. Just opposite is true. Americans 【M4】______
expect a great deal from marriage. They seak physical, emotional,
and intellectual compatibility. They want to be loved deep and 【M5】______
understood. It s because Americans expect so much from marriage that
so many get divorce. They prefer no marriage at all to a marriage【M6】______
without love and Understanding. Which typical American optimist, 【M7】______
they end one marriage in the hope of that the next will be happier.【M8】______
With no fault divorce taws in many states, it is easier than never to【M9】______
get a divorce. Some American women stay in unhappy marriages be
cause they do not have the education or job experience to support
themselves and their children. But most American women believe
that, if necessary, they can make it lonely without a husband. All 【M10】______
things considered, Americans have little reason to continue an
unhappy marriage.
【M1】

The author says that foregoing a college education is often not a wise choice because ______ of the 50 highest paying jobs require a four-year college degree except for air traffic controllers and nuclear power reactor operators.

Write a short composition of about 150 words on the topic given below.
Topic: Comment on the Development of the Internet

Among different layers of security approach at airports, which one is growing more important?

答案查题题库