-
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
-
notepad
用vb编写的记事本,可以实现记事本的大部分功能(notepad based vb)
- 2014-04-28 15:05:12下载
- 积分:1
-
XIAO_Fei_09621576g
GPS定位程序,利用最小二乘法进行计算得出结果(GPS positioning process is calculated using the results of least-squares method)
- 2020-07-10 17:28:54下载
- 积分:1
-
AgentLite-Win
Android Studio 源代码工程,帮助大家查阅审核,编写时可以做参考(Android Studio Main Project)
- 2020-06-19 01:00:02下载
- 积分:1
-
简单的网络双机备份程序
简单的网络双机备份程序-Simple two-machine network backup program
- 2022-04-29 21:41:18下载
- 积分:1
-
VBScript
VBScript语言参考.chm,,,,,(VBScript Language Reference. Chm ,,,,,)
- 2009-04-01 19:33:52下载
- 积分:1
-
CPP-use-shared-memory-
C++ 使用共享内存实现进程间通信。
文件映射是一种实现进程间单向或双向通信的机制。它允许两个或多个本地进程间相互通信。为了共享文件或内存,所有的进程必须使用相同的文件映射的名字或是句柄。
为了实现共享文件,第一个进程先调用CreateFile方法。接下来调用CreateFileMapping方法来创建一个文件映射对象。并为文件映射指明一个句柄和名称。由于事件,信号,互斥对象和文件映射等这些内核对象都共享同一个名字空间,所以如果这个名字和其他一个对象的名称重名的话那么将创建失败。(C++ use shared memory to achieve inter-process communication)
- 2014-03-10 20:09:42下载
- 积分:1
-
This is an automatically updated online VC procedures, enclosing detailed descri...
这是一个自动更新的VC在线程序,附详细说明和使用方法!
- 2022-08-19 13:31:10下载
- 积分:1
-
PictureCombine
基于JAVA开发平台的数字拼图游戏,其实现较为简单,刚学完JAVA,为初作!(JAVA development platform based on the number of jigsaw puzzle, and its relatively simple to achieve, after just learning JAVA, for the early!)
- 2009-04-11 12:41:49下载
- 积分:1
-
AboutDialog
java实现的电子白板程序,功能完善,代码适合初学者.(java implementation of the whiteboard program, perfect function, the code is suitable for beginners.)
- 2012-05-24 13:37:52下载
- 积分:1