若vehicle=[['train','car'],['bus','subway'],['ship','bicycle'],['car']],则len(vehicle[1][0])结果是什么? A.3B.7C.6D.4
若vehicle=[['train','car'],['bus','subway'],['ship','bicycle'],['car']],则len(vehicle[1][0])结果是什么?
A.3
B.7
C.6
D.4
相关考题:
I can’t afford a bicycle, _______ a car. A. not to speakB. not to mentionC. that’s to sayD. let alone
In order to cut down on the carbon emission, more people choose to travel_.A.by electric car, bicycle or planeB.by private car, bicycle or busC.by bus, electric car or planeD.by bicycle, bus or electric car
请使用VC6或使用【答题】菜单打开考生文件夹proj2下的工程proj2,其中定义了vehiele类,并派生出motorcar类和bicycle类。然后以motorcar和bicycle作为基类,再派生出motorcycle类。要求将Vehicle作为虚基类,避免二义性问题。请在程序中的横线处填写适当的代码并删除横线,以实现上述类定义。此程序的正确输出结果应为:801501001注意:只能在横线处填写适当的代码,不要改动程序中的其他内容,也不要删除或移动“//****found****”。includeiostream.hclass vehicle{private:int MaxSpeed;int Weight;public://*************found************vehicle(int maxspeed,int weight):——~vehicle{};int getMaxSpeed{return MaxSpeed;}int getWeight{retum Weight;}};//****************found************class bicycle:——public vehicle{private:int Height;public:bicycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),Height(height){}int getHeight{retum Height;};};//*******************found**************class motorcar:——public vehicle{private:int SeatNum;public:motorcar(int maxspeed。int weight,int seatnum):vehicle(maxspeed,weight),SeatNum(seatnum){}int getSeatNum{return SeatNum;};};//*****************found***************class motorcycle:——{public:motorcycle(int maxspeed,int weight,int height):vehicle(maxspeed,weight),bicycle(maxspeed,weight,height),motorcar(maxspeed,weight,1){}};void main{motorcycle a(80,150,100);couta.getMaxSpeedendl;couta.getWeightendl;couta.getHeightendl;couta.getSeatNumendl;}
根据短文内容判断给出的语句是否正确,正确的写“T”,错误的写“F”。Pedestrian Critically Injured in Westwood HitandRun CrashA pedestrian was critically injured in a Westwood area car accident near the comer of Wilshire Boulevard and Veteran Avenue early morning on January 5, 2016.The police said it involved a hitandrun driver. The car was dark and was last seen traveling east on Ashton Avenue from Veteran Avenue. The investigation is ongoing.It appears that the driver struck and seriously injured the pedestrian, and left the victim lying in the roadway without even stopping to help or call emergency personnel. Outrageous! Leaving the scene of an injury or fatal crash is a serious crime under California law. California Vehicle Code 20001(a)states:“The driver of a vehicle involved in an accident resulting in injury to a person, other than himself or herself, or in the death of a person shall immediately stop the vehicle at the scene of the accident.”We hope the driver in this case is arrested and brought to justice. If you have any information about the suspect or the vehicle, please visit the HitandRun Reward website at hitandrunreward.com to offer a useful tip and become qualified for a $1,000 reward.( )21. A pedestrian was dead in the hitandrun case.( )22. Leaving the scene of an injury or fatal crash is not a serious crime under California law.( )23. The investigation is going on.( )24. The driver was against the California Vehicle Code 20001.( )25. Any information about hitand run cases provided via hitandrunreward.com can get $1,000 reward.
使用VC6打开考生文件夹下的工程test17_1,此工程包含一个源程序文件test17_1.唧,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:Vehicle messageCar messageVehicle message源程序文件test17_1.cpp 清单如下:include <iostream.h>class vehicle{int wheels;float weight;public:/***************** found *****************/void message(void){ cout<<"Vehicle message\n";}};class car:public vehicle{int passenger_load;public:/***************** found *****************/void message (void){cout>>"Car message\n";}};class truck:public vehicle{int passenger_load;float payload;public:int passengers(void){return passenger_load;}};void main(){vehicle * unicycle;unicycle=new vehicle;/***************** found *****************/unicycle.message()delete unicycle;unicycle=new car;unicycle->message();delete unicycle;unicycle=new truck;unicycle->message();delete unicycle;}
11.abstractclassVehicle{publicintspeed(){return0;}}12.classCarextendsVehicle{publicintspeed(){return60;}}13.classRaceCarextendsCar{publicintspeed(){return150;}}......21.RaceCarracer=newRaceCar();22.Carcar=newRaceCar();23.Vehiclevehicle=newRaceCar();24.System.out.println(racer.speed()+,?+car.speed()25.+,+vehicle.speed());Whatistheresult?()A.0,0,0B.150,60,0C.Compilationfails.D.150,150,150E.Anexceptionisthrownatruntime.
若已定义了类Vehicle,则下列派生类定义中,错误的是A.class Car:Vehicle{/*类体略*/);B.class Car:public Car{/*类体略*/);C.class Car:public Vehicle{/*类体略*/);D.class Car:virtual public Vehicle{/*类体略*/);
若vehicle=['train','car','bus','subway','ship','bicycle','car'],则vehicle.count('car')结果是什么? A.carB.7C.1D.2
若vehicle=[['train','car'],['bus','subway'],['ship','bicycle'],['car']],则len(vehicle)结果是什么? A.1B.7C.6D.4
若vehicle=[['train','car'],['bus','subway'],['ship','bicycle'],['car']],则len(vehicle[1])结果是什么? A.2B.7C.6D.4
阅读以下说明和C++代码,填充代码中的空缺,将解答填入答题纸的对应栏内。【说明】某应急交通控制系统(TraficControISy ,tem)在红灯时控制各类车辆(Vehicle)的通行,其类图如图5-1所示,在紧急状态下应急车辆红灯时也可通行,其余车辆按正常规则通行。下面的C++代码实现以上设计,请完善其中的空缺。include typeinfoinclude iostreamusing namespace std;class Vehicle {/*抽象基类,车辆*/public :virtual void run () = 0;};class Emergency( /*抽象基类,可在红灯时通行的接口,函数均为纯虚函数*/public:(1)=0 //isEmergent()函数接口(2)=0 //runRedLight()函数接口};class Car: public Vehicle {public :-car(){ }void run () { /*代码略*/ }};Ciass Truck:public vehicie {Public;-Truck(){ }Void run() { /*代码略*/}};Class policecar: (3) {Private:bool isEmergency;public :PoliceCar () : Car () , Emergency () { this=isEmergency = false;}PoliceCar (bool b) : Car () , Emergency () { this=isEmergency = b; }~PoliceCar () { }bool isEmergent () { ret irn (4) ; }void runRedLight () { /*代码略*/ }};/*类Ambulance. FireEngine/*实现代码略*/class TraficControISystem {/*交通控制类*/private :Vehicle*v[24]; int numVeh: cles./*在构造函数中设置初始值为0*/public:void control(){ //控制在紧急情况下应急车辆红灯通行,其他情况按常规通行for (int i = 0; i[numVehicles;++] {Emergency*ev=dynamic_castEmergency*(v[i]);if (ev !=0(5)-: runRedLight ( )Else (6)-:run()}}Void add(vehicle){v[numvehicles++]=vehicle;}/*添加车辆*/Void shutdown(){for (int i =0;inumvehicles;i++){ deletev[i];} }}int main () {TraficControlSystem* tcs =new TraficControlSystem;tcs-add (new Car () );, t cs-add (new PoliceCar ()) ;tcs-add (new Ambulance ()) ; tcs- add (new Ambulance (true)) ;tcs-add (new FireEngine (true)) ; -.cs-add (new FireEngine ()) ;tcs-add (new Truck ()) ;tcs-control () ; tcs-shul Down ( ) ;delete tcs;}
阅读以下说明和Java代码,填充程序中的空缺,将解答填入答题纸的对应栏内。【说明】某应急交通控制系统(TraficControIS,stem)在红灯时控制各类车辆(Vehicle)的通行,其类图如图6-1所示,在紧急状态下应急车辆在红灯时可通行,其余车辆按正常规则通行。下面的Java代码实现以上设计,请完善其中的空缺。【Java代码】abstract class Vehiclepublic Vehicle () { }abstract void run};interface Emergency {(1) ;(2) ;}class Car extends Vehicle {public Car () { }void run () { /*代码略*/ }};class Truck extends Vehicle {public Truck () { }void run () { /*代码略*/ }class PoliceCar (3)boolean isEmergency = false;public PoliceCar () { }public PoliceCar(boolean b) { this . isEmergency =b; }public boolean isEmergent () { return (4); }public void runRedLight () { /*代码略*/ }}/*类Ambulance. FireEngine实现代码略*/public class TraficControISystem {/。交通控制类。/private Vehicle[ ]V=new Vehiele [24];int numVehicles;public void control() {for (int i=0; inumVehicles; i++) {if (v[i] instanceof Enu rgency ((Emergency)V [i])isEmergent()) {( 5 ) . runRedLigh: ( ) ;}else(6).run( )}}void add (Vehicle vehicle) { v[numVehicles++]=vehicle;)/*添加车辆*/void shutDown()(/*代码略*/}public static void main (Stri.ng [ ] args) {TraficControlSystem tcs = new TraficControlSystem() ;tcs . add (new Car () ;tcs .add (new PoliceCar () ;tcs .add (new Ambulance () ;tcs . add (new Ambulance (true》 ;tcs . add (new FireEngine ( true》 ;tcs . add (new Truck () ;tcs . add (new FireEngine ( ) ;tcs . control () ;tcs . shutDown () ;}}
29. When people travel on business(出差) ,they usually take _________ .A. a train or a planeB. a boat or a trainC.a car or a boat .D.a plane or a car
In order to cut down on the carbon emission,more people choose to travel______.A.by electric car,bicycle or planeB.by private car,bicycle or busC.by bus,electric car or planeD.by bicycle. bus or electric car
阅读以下说明和Java代码,填充程序中的空缺,将解答填入答题纸的对应栏内。[说明]某应急交通控制系统(TraficControlSystem)在红灯时控制各类车辆(Vehicle)的通行,其类图如下图所示,在紧急状态下应急车辆在红灯时可通行,其余车辆按正常规则通行。下面的Java代码实现以上设计,请完善其中的空缺。[Java代码]abstract class Vehicle{public Vehicle(){ }abstract void run();};interface Emergency{ ______; ______;};class Car extends Vehicle{public Car(){ }void run(){ /*代码略*/ }};Class Truck extends Vehicle{public Truck(){ }void run() { /*代码略*/ }};class PoliceCar ______ {boolean isEmergency= false;public PoliceCar(){ }public PoliceCar(boolean b) {this.isEmergency=b; }public boolean isEmergent(){ return ______ }public void runRedLight(){ /*代码略*/ }};/*类Ambulance、FireEngine实现代码略*/public class TraficControlsystem { /*交通控制类*/private Vehicle[]V=new Vehicle[24];int numVehicles;public void control(){for {int i=0; i<numVehicles; i++){if(V[i]instanceof Emergency}else______. run();}}void add(Vehicle vehicle){ v[numVehicles++]=vehicle;}/*添加车辆*/void shutDown(){/*代码略*/}public static void main(String[]args){TraficC0ntrolSystem tcs=new TraficControlSystem();tcs.add(new Car());tcs.add(new PoliceCar());tcs.add(new Ambulance());tcs.add(new Ambulance(true));tcs.add(new FireEngine(true));tcs.add(new Truck());tcs.add(new FireEngine());tcs.control();tcs.shutDown();}}
阅读以下说明和C++代码,填充代码中的空缺,将解答填入答题纸的对应栏内。[说明]某应急交通控制系统(TraficControlSystem)在红灯时控制各类车辆(Vehicle)的通行,其类图如下图所示,在紧急状态下应急车辆红灯时也可通行,其余车辆按正常规则通行。下面的C++代码实现以上设计,请完善其中的空缺。[C++代码]#include<typeinfo>#include<iostream>using namespace std;class Vehicle {/*抽象基类,车辆*/public:virtual void run()=0;};class Emergency { /*抽象基类,可在红灯时通行的接口,函数均为纯虚函数*/public:______=0; //isEmergent()函数接口______=0; //runRedLight()函数接口};clasS Car:public Vehicle{public:~Car(){}void run(){/*代码略*/ ));class Truck:public Vehicle{public:~Truck(){}void run(){ /*代码略*/ });class PoliceCar:______ {private:bool isEmergency;public:PoliceCar():Car(),Emergency() { this->isEmergency=false;}PoliceCar(bool b):Car(),Emergency() {this->isEmergency=b;}~P0liceCar(){ }bool isEmergent(){ return ______}void runRedLight() { /*代码略*/ });/*类Ambulance、FireEngine实现代码略*/class TraficControlsystem { /*交通控制类*/private:Vehicle*v[24]; int numVehicles;/*在构造函数中设置初始值为0*/public:void control(){ //控制在紧急情况下应急车辆红灯通行,其他情况按常规通行for(int i=0;i<numVehicles; i++){Emergency *ev=dynamic_cast<Emergency*>(v[i]);if(ev !=0) ______->runRedLight();else ______->run();}}void add(Vehicle*vehicle) { v[numVehicles++] =vehicle; }/*添加车辆*/void shutDown() {for(int i=0; i<numVehicles; i++) { delete v[i];} }};int main(){TraficControlSystem*tcs=new TraficControlSystem;tcs->add(new Car()); tcs->add(new PoliceCar());tcs->add(new Ambulance()); tcs->add(new Ambulance(true));tcs->add(new FireEngine(true));tcs->add(new FireEngine());tcs->add(new Truck());tcs->contr01();tcs->ShutDown();delete tcs;}
The school has made it a rule that no student shall take an illegal vehicle __________a school bus.A.other thanB.rather thanC.or rather D.or else
()is the volume for loading goods of the vehicle.A、Vehicle tonnageB、Vehicle sizeC、Vehicle capacityD、Available Vehicle capacity
单选题How did the narrator and his aunt travel to see his father?ABy car.BBy bus.CBy ship.DBy train.
单选题What is suggested about Ms. Forsyth?AShe is knowledgeable about cars.BHer employer will pay for her vehicle.CShe is planning to buy her first vehicleDHer current car is unreliable.
单选题11. abstract class Vehicle { public int speed() { return 0; } } 12. class Car extends Vehicle { public int speed() { return 60; } } 13. class RaceCar extends Car { public int speed() { return 150; }} ...... 21. RaceCar racer = new RaceCar(); 22. Car car = new RaceCar(); 23. Vehicle vehicle = new RaceCar(); 24. System.out.println(racer.speed() + “, „ + car.speed() 25. + “, “+ vehicle.speed()); What is the result?()A 0, 0,0B 150, 60, 0C Compilation fails.D 150, 150, 150E An exception is thrown at runtime.