-
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
-
change-the-voice
在Eclipse开发环境下,可以直接导入,导入之后可以依据自己的情况,改变音量调节的大小,同时还可以自行设计音量进度条的显示方式(In the Eclipse development environment, you can directly import, after import can be based on their own circumstances, to change the size of the volume control, but also can design their own volume progress bar is displayed)
- 2013-09-23 20:07:35下载
- 积分:1
-
2004530162841
Java聊天室系统详细设计,包括程序实现,数据库设计等(The detailed design of Java chat room system)
- 2009-09-18 20:29:36下载
- 积分:1
-
namespace-walkdog
小狗赛跑小游戏,使用java语言编写,walkdog.doc(Dog racing games, using java language, walkdog.doc)
- 2014-04-20 18:40:46下载
- 积分:1
-
Gradients
图形设计跟随趋势,而当前的趋势是到处使用渐变,除了这个风尚,渐变可以用来创建反射和淡出这样的高级效果。(Graphic design to follow the trend, and the current trend is everywhere to use gradients, in addition to the fashion, the gradient can be used to create such a high-level reflection and fade out effect.)
- 2010-07-28 10:48:02下载
- 积分:1
-
ch06
这是一个关于java学习的视频教程,详细的介绍了java的基础知识的学习.(This is a java tutorial to learn about the video, details about the java of learning.
)
- 2010-09-29 18:16:04下载
- 积分:1
-
stvndard
C语言编程实例目录,PDF C语言编程实例目录,不错的源码()
- 2018-05-13 20:17:55下载
- 积分:1
-
ProducerConsumerProblem
说明: 关于操作系统生产者与消费者的源码,没有解压密码.(operating system on producers and consumers of the source, without extracting passwords.)
- 2005-11-06 16:05:24下载
- 积分:1
-
WEB_WORKFLOW
主要提供自定义工作流开发的资料,欢迎访问作者博客(Primarily provide custom workflow development information, please visit the author blog)
- 2013-10-31 03:24:33下载
- 积分:1
-
StringBuilder
String Builder extends Abstract String Builder implements Appendable.
- 2014-01-06 14:49:49下载
- 积分:1