汽车(Car)由轮子、发动机、油箱、座椅、方向盘等组成,那么Car类和其他类(Wheel、 Engin、Tank、 Chair、 Steering Wheel)之间的关系是()A.关联关系B.泛化关系C.实现关系D.依赖关系
汽车(Car)由轮子、发动机、油箱、座椅、方向盘等组成,那么Car类和其他类(Wheel、 Engin、Tank、 Chair、 Steering Wheel)之间的关系是()
A.关联关系
B.泛化关系
C.实现关系
D.依赖关系
参考答案和解析
D
相关考题:
请阅读以下技术说明、类图及C++代码,根据要求将(1)~(5)空缺处的内容填写完整。[说明]已知对某载客车辆(Car)进行类建模,如图4-19所示。其中,类Engine表示发动机引擎,类Wheel表示车轮,类Body表示车身,类Driver表示司机,类Passenger表示乘客。[C++代码]car.run();}
请阅读以下技术说明、类图及Java代码,根据要求将(1)~(5)空缺处的内容填写完整。[说明]已知对某载客车辆(Car)进行类建模,如图4-20所示,其中类Engine表示发动机引擎,类Wheel表示车轮,类Body表示车身,类Driver表示司机,类Passenger表示乘客。
阅读下列说明、图和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();}}
若已定义了类Vehicle,则下列派生类定义中,错误的是A.class Car:Vehicle{/*类体略*/);B.class Car:public Car{/*类体略*/);C.class Car:public Vehicle{/*类体略*/);D.class Car:virtual public Vehicle{/*类体略*/);
阅读下列说明、图和Java代码,填补空缺。[说明]已知对某载客车辆(Car)进行类建模,如图13-2所示,其中类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.printin("司机尚未上车!"); 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( );}}
阅读下列说明、图和C++代码,填补空缺。[说明]已知对某载客车辆(Car)进行类建模,如图12-2所示,其中类Engine表示发动机引擎,类Wheel表示车轮,类Body表示车身,类Driver表示司机,类Passenger表示乘客。const int __________ =7; //定义最多载客数const int MAX_WHEELS=5; //定义最多轮胎数class Body{ //此处代码省略 ); //车身类class Passenger{ //此处代码省略}; //乘客类Class Wheel{ //此处代码省略}; //车轮类Class Driver{ //司机类public:string name; //表示第几路公交车司机Driver(string driverName):marne( __________ ){}; //构造函数};class Engine{ //引擎类public:string engineNo; //引擎编号Engine(string engineNo){ __________ ->engineNo=engineNo; }//构造函数};Class Car{ //汽车类protected:Engine *engine; Driver *driver; Body body;Wheel *wheels[MAX_WHEELS]; Passenger *passengers[MAX_PASSENGERS];public:Car(Driver *driver)( //构造函数this->driver=driver;engine=new Engine("TX653 6型号引擎");for(int index=0; index<MAX_WHEELS; index++){wheels[index]=new Wheel( );}for(int index=0; index passengers[index]=NULL;}}virtual -Car( ){ //析构函数for (int index=0; index<MAX_WHEELS; index++)delete wheels[index];delete __________ ;}int getPassengerNumber( ){ //获取车上乘客数量//此处代码省略}void getonpassenger(Passenger *apassenger ){//乘客上车//此处代码省略}void run( ){ //开车if(driver==NULL){cout<< "司机尚未上车!"; return; }//此处代码省略}};void main( ){Driver driver("第五路公交车司机");Car car( __________ );Passenger passengers[MAX_PASSENGERS];for(int index=0; index<MAX_PASSENGERS; index++)//乘客上车处理car. getOnPasSenger(passengers[index]);car. run( );}
试题七(共 15 分)阅读下列说明、图和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();}}
试题五(共 15 分)阅读下列说明、图和C++代码,将应填入 (n) 处的字句写在答题纸的对应栏内。[说明]已知对某载客车辆(Car)进行类建模,如图 5-1所示,其中类 Engine 表示发动机引擎,类 Wheel 表示车轮,类 Body 表示车身,类 Driver 表示司机,类 Passenger 表示乘客。[C++代码]const int (1) = 7; //定义最多载客数const int MAX_WHEELS = 5; //定义最多轮胎数class Body{ //此处代码省略 }; //车身类class Passenger{ //此处代码省略 }; //乘客类class Wheel{ //此处代码省略 }; //车轮类class Driver{ //司机类public:string name; //表示第几路公交车司机Driver(string driverName):name( (2) ){}; //构造函数};class Engine{ //引擎类public:string engineNo; //引擎编号Engine(string engineNo){ (3) -engineNo = engineNo; } //构造函数};class Car{ //汽车类protected:Engine * engine; Driver * driver; Body body;Wheel * wheels[MAX_WHEELS]; Passenger * passengers[MAX_PASSENGERS];public:Car(Driver *driver){ //构造函数this-driver = driver;engine = new Engine("TX6536 型号引擎");for (int index = 0; index MAX_WHEELS; index++){wheels[index] = new Wheel();}for (int index = 0; index MAX_PASSENGERS; index++){passengers[index] = NULL;}}virtual ~Car(){ //析构函数for (int index=0; index MAX_WHEELS; index++)delete wheels[index];delete (4) ;}int getPassengerNumber(){ //获取车上乘客数量//此处代码省略}void getOnPassenger(Passenger * aPassenger ){ //乘客上车//此处代码省略}void run(){ //开车if(driver == NULL){ cout "司机尚未上车!"; return; }//此处代码省略}};void main(){Driver driver("第五路公交车司机");Car car( (5) );Passenger passengers[MAX_PASSENGERS];for (int index = 0 ; index MAX_PASSENGERS; index ++) //乘客上车处理car.getOnPassenger(passengers[index]);car.run();}
When steering by hand,which of the following may be a functional input to the steering gear as a result of turning the wheel ________.A.Non-follow-upB.Rudder adjustmentC.Weather adjustmentD.All the above may be activated
In an electro-hydraulic steering system, rudder movement is maitained in close synchronization with the steering wheel position by means of the ______.A.trick wheelB.follow-up controlC.six-way valveD.Rapson slide
阅读下列说明和Java代码,将应填入(n)处的字句写在答题纸的对应栏内。【说明】某软件公司欲开发一款汽车竞速类游戏,需要模拟长轮胎和短轮胎急刹车时在路面上留 下的不同痕迹,并考虑后续能模拟更多种轮胎急刹车时的痕迹。现采用策略(Strategy)设计模式来实现该需求,所设计的类图如图 5-1 所示。【Java代码】import java.util.*; interface BrakeBehavior{public (1) ;/*其余代码省略*/}class LongWheelBrake implements BrakeBehavior{public void stop(){System.out.println("模拟长轮胎刹车痕迹! ");}/*其余代码省略*/}class ShortWheelBrake implements BrakeBehavior {public void stop(){System.out.println("模拟短轮胎刹车痕迹! ");}/*其余代码省略 */}abstract class Car{protected (2) wheel;public void brake(){ (3) ;}/*其余代码省略*/}class ShortWheelCar extends Car {public ShortWheelCar(BrakeBehavior behavior){(4) ; } /*其余代码省略*/}class StrategyTest{public static void main(String[]args){BrakeBehaviorbrake =new ShortWheelBrake();ShortWheelCar car1= new ShortWheelCar(brake);car1. (5) ;}}
Questions 182-183 refer to the following information.Introducing the product, This product generally ships within 2 business day (s) from Pinellas Park, Fords and weighs 2 pound (s). Attaches to your steering wheel for easy access to a writing and drink storage surface. The Go Office Wheel Mate Steering Wheel Desk is flat for writing and perfect for lunch or a snack. This Go Office Wheel Mate Steering Wheel Desk stores neatly in your car when used with the larger Auto Exec Laptop Car Desk. For safety reasons, never use this productwhile driving. Easily convert your car into your personal automobile office with the Wheel Mate car desk by this product. For safety, it is advised not to use this product when you are _______A. having lunch or a snackB. working at officeC. driving a carD. writing a letter
Questions 182-183 refer to the following information.Introducing the product, This product generally ships within 2 business day (s) from Pinellas Park, Fords and weighs 2 pound (s). Attaches to your steering wheel for easy access to a writing and drink storage surface. The Go Office Wheel Mate Steering Wheel Desk is flat for writing and perfect for lunch or a snack. This Go Office Wheel Mate Steering Wheel Desk stores neatly in your car when used with the larger Auto Exec Laptop Car Desk. For safety reasons, never use this productwhile driving. Easily convert your car into your personal automobile office with the Wheel Mate car desk by this product.Who may use this product?A. Drivers B. Writers C. Office works D. Car repairmen
UML关系包括关联、聚合、泛化、实现、依赖等5种类型,请指出下面关系的类型,并采用UML符号表示这些关系。 (1)在学校中,一个学生可以选修多门课程,一门课程可以由多个学生选修,那么学生和课程之间是什么关系? (2)类A的一个操作调用类B的一个操作,且这两个类之间不存在其他关系,那么类A和类B之间是什么关系? (3)接口及其实现类或构件之间是什么关系? (4)一个汽车有四个轮子,那么类“汽车”和“轮子”之间是什么关系? (5)学生与研究生之间是什么关系?
The sailor on gangway watch should ().A、keep sharp lookout at the forecastleB、receive visitorsC、expect the agentD、steering wheel
单选题The()of the telemotor is built the steering wheel console and located on the bridge.AtransmitterBreceiverCpipesDcharging unit
单选题When the vessels steering wheel on the navigation bridge is turned, the difference existing between the position of the wheel and that of the rudder is known as ().Aproportional bandBthe error signalCthe reset signalDfeedback
问答题UML关系包括关联、聚合、泛化、实现、依赖等5种类型,请指出下面关系的类型,并采用UML符号表示这些关系。 (1)在学校中,一个学生可以选修多门课程,一门课程可以由多个学生选修,那么学生和课程之间是什么关系? (2)类A的一个操作调用类B的一个操作,且这两个类之间不存在其他关系,那么类A和类B之间是什么关系? (3)接口及其实现类或构件之间是什么关系? (4)一个汽车有四个轮子,那么类“汽车”和“轮子”之间是什么关系? (5)学生与研究生之间是什么关系?
单选题Rudder motion is prevented from exceeding the movement of the steering wheel by the()Areturn springsBsix-way valveCfollow-up gearDdifferential gear
单选题The required rudder angle is transmitted hydraulically or electrically from the steering wheel at the bridge to the ()at the steering gear, just above the rudder.AtransmitterBtele-motorChydraulic ramDhydraulic cylinder
单选题The follow-up gear on an electro-hydraulic steering gear()Arelieves excessive fluid pressureBtakes the pump off stroke when the desired rudder angle is attainedCsynchronizes wheel position with the rudder positionDreturns the rudder to midposition when the wheel is released
单选题In an electro-hydraulic steering system, under movement is maintained in close synchronization with the steering wheel position by means of the ().Atrick-wheelBfollow-up controlCsix-way valveDRapson slide
单选题The hand steering is a method by which the motion of the rudder is controlled with ().Aa motor-driven steering wheelBa pneumatic steering wheelCa hand-driven steering wheelDan electric steering wheel