-
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
-
sendmail
邮件收发系统,实现了邮件发送以及新邮件的下载以及显示(Send and receive e-mail system, the realization of the e-mail and download new messages as well as the display)
- 2008-12-23 13:21:45下载
- 积分:1
-
Stream
信息安全的课程实验 内容是 流密码 java版(Information security stream cipher java version)
- 2013-12-26 19:54:52下载
- 积分:1
-
Sketch
说明: 学习用的,很简单的图形界面.它是一个简单的界面,加事件,以及2D的图形绘制的例子(the study, a very simple graphic interface. It is a simple interface, plus events, and the 2D graphic example)
- 2005-12-01 22:28:59下载
- 积分:1
-
ch05
讲述了动态注册程序DynaCheckRegister,其中src目录用来存放服务器端的java程序,dynareg目录是用来部署的模块,里面包括使用到的页面文件(About the dynamic registration procedures DynaCheckRegister, including src directory is used to store server-side java programs, dynareg directory is used to deploy the modules, which include the use of to the page file)
- 2009-09-13 10:27:05下载
- 积分:1
-
GN
说明: GN算法是一种经典的web社区发现算法,java语言。可用实例验证(the GN algorithm is a kind of classic web community discovery algorithm
)
- 2014-04-25 20:33:11下载
- 积分:1
-
magiclen.org_libdmtx-java
libdmtx库的使用及对data matrix码检测识别(Use of libdmtx library and detection and identification of data matrix code)
- 2020-10-28 10:29:58下载
- 积分:1
-
DHUtil
utility class for converting jce/jca DH objects objects into their org.bouncycastle.crypto counterparts.
- 2013-12-11 13:18:31下载
- 积分:1
-
GenericURI
Implementation of the URI class. This relies on the 1.4 URI class.
- 2013-12-06 14:48:38下载
- 积分:1
-
GEF-runtime-3.2
eclipse插件 gef-runtime-3.2 非常好用 谁用谁知道(The eclipse plugin gef-runtime-3.2 is very useful who knows who)
- 2012-08-08 00:10:04下载
- 积分:1