-
Exe4_3
3.已知车辆(Vehicle)包括机动车(MotoVehicle)和非机动车(NonMotorVehicle)2种。小汽车(Car)、公交车(Bus)等属于机动车,自行车(Bicycle)等属于非机动车。随着能源技术的发展,出现了电动自行车(ElectricBicycle)、电动小汽车(ElectricCar)、天然气公交车(NaturalGasBus)等新型车辆。车辆的共同特征是都能够运行(run),并且有唯一的5位车牌号(LicenseNumber)。机动车的共同特征是采用燃油发动机(FuelEngine),且能够驾驶(drive)。自行车的共同特征是能够骑行(ride)。电动车辆的共同特征是由电池(Battery)驱动。天然气车辆的共同特征是采用天然气(NaturalGas)作为动力。
要求:
(1)设计一个类体系描述上述车辆,写出它们的属性和方法。
(2)一家公司(Company)拥有10辆普通小汽车、5辆公交车、2辆电动小汽车和1辆天然气公交车,要求写一个方法listVehicles()显示所有车辆的信息(车牌号以及采用的动力)。
程序文件命名为Exe4_3.java。(3. Known vehicle (Vehicle) including motor vehicle (MotoVehicle) and non-motorized (NonMotorVehicle) 2 species. Cars (Car), bus (Bus), etc. to motor vehicles, bicycles (Bicycle), etc. are non-motor vehicles. With the development of energy technologies, the emergence of electric bicycles (ElectricBicycle), electric cars (ElectricCar), natural gas buses (NaturalGasBus) and other new vehicles. A common feature of the vehicle is able to run (run), and there are only five license plate number (LicenseNumber). Common feature is the use of a motor vehicle fuel engine (FuelEngine), and is capable of driving (drive). Common feature is the ability to ride a bike (ride). Common characteristics of the electric vehicle is driven by a battery (Battery). A common feature is the use of natural gas vehicles (NaturalGas) as the driving force.
Claim:
(1) describe the design of a class system of the vehicle, write their properties and methods.
(2) a company (Company) owns 10 ordinary cars, five buses, )
- 2015-06-14 18:22:51下载
- 积分:1
-
jhtp7_SSM_15
jhtp7_SSM_01.pdf
Include the solution of partof how to program JAVA 7e
- 2011-07-23 15:56:25下载
- 积分:1
-
灰色模型
说明: 灰色模型,包括残差修正模型,matlab可直接使用,亲测有效(Grey model, including residual correction model, matlab can be used directly, effective pro test)
- 2019-12-12 11:14:45下载
- 积分:1
-
src
基于动态规划算法,用java实现的自动对联程序(Automatically couplet procedures based on dynamic programming algorithm, implemented in Java)
- 2012-05-28 13:26:16下载
- 积分:1
-
_Bits
Test the class {@code com.android.dx.util.Bits} for Java.
- 2013-10-02 01:36:01下载
- 积分:1
-
610161341
一个等值线控件可以绘等高线counter(a contour controls can be drawn contours counter)
- 2006-07-16 15:47:12下载
- 积分:1
-
Poker
用JAVA语言编写的发牌程序,能够实现随机发牌的功能。(Using Java language licensing procedures, random licensing.)
- 2013-05-16 19:03:16下载
- 积分:1
-
yymDB
实现了一个简单的数据库功能.包括 录入,查询,修改,显示所有记录,等等的基本的数据库功能 .(It implements a simple DB function,includes inputting,querying,modifying and displaying all the records,etc.)
- 2005-07-09 19:27:17下载
- 积分:1
-
SendMsg_webchinese
中国网建网的发短信代码,中国网建网的发短信代码(this is java code about sms,u can use it send sms.....)
- 2013-08-01 17:42:36下载
- 积分:1
-
079npcJS
说明: 冒险岛079私服 冒险岛JS 冒险岛服务端NPC脚本 JS文件 转生 VIP 满技能等商业脚本(Adventure Island 079 private service Adventure Island JS Adventure Island server NPC script JS file rebirth VIP full skills and other business scripts)
- 2020-01-06 22:46:16下载
- 积分:1