-
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
-
Eight_puzzle
八数码问题和舰科技符合时刻记得和反馈记得和反馈及时反馈记得是(eightnumberggfdghffhgfhgfhgfhgfhjgjghkj)
- 2009-05-25 01:21:09下载
- 积分:1
-
Jdk14Logger
Jdk14Logger implements Log, Serializable.
- 2014-02-18 14:22:09下载
- 积分:1
-
old
群体智能算法,烟花算法,java代码,(fireworks algorithm)
- 2020-10-27 18:09:59下载
- 积分:1
-
DrClient
java版Drcom宽带认证客户端,配置后认证服务器ip后,可直接使用。(Campus network Dr.COM login client java version, convenient for users to do other platforms to develop and use.)
- 2017-12-05 14:04:57下载
- 积分:1
-
jd-gui-1.4.0
说明: Java decoder, decomplier
- 2020-06-22 18:40:01下载
- 积分:1
-
mybatis 整合后的项目
myabtis 整合后的项目 可直接使用(Myabtis integrated projects can be used directly)
- 2020-06-19 12:00:06下载
- 积分:1
-
jspmanage
仓库管理系统,用纯jsp页面编写,没有javabean内容,学习jsp页面者首选例子(Warehouse management system, with the preparation of pure jsp page, there is no JavaBean content, learning from the preferred example of jsp page)
- 2008-02-20 12:00:48下载
- 积分:1
-
test
主要是用注解 将struts2 spring hibernate弄到一起(Is mainly used notes to get together struts2 spring hibernate)
- 2010-05-21 16:36:08下载
- 积分:1
-
Java-from-the-rookie-to-Benniao
在众多朋友的支持和鼓励下,《Java程序员由菜鸟到笨鸟》电子版终于和大家见面了。本电子书涵盖了从java基础到javaweb开放框架的大部分内容。(In many friends for their support and encouragement, " Java programmers from the rookie to Benniao" electronic version, and we finally met. The book covers most of the content from the java-based to javaweb open framework.)
- 2014-04-21 21:01:53下载
- 积分:1