PRO192_-_PE01_-_FA_2024_2886.webp
H

PRO192_-_PE01_-_FA_2024_2886.webp

Vehicle
- fuel Type: String
Where:
- model:String
- fuelEfficiency: double
+ Vehicle(model: String, fuelType:String, fuelEfficiency: double)
+ getModel(): String
+ getFuel Type(): String
+ getFuel Efficiency(): double
+ calculateFuel Efficiency():double
+ calculate Distance Traveled():double
Vehicle(model: String, fuel Type: String,fuel Efficiency: double): parameterized
constructor that sets values to model, fuel Type,and fuel Efficiency.
getModel(): String - return the model.
getFuel Type(): String-return the fuel Type
getFuel Efficiency(): double-return the
fuel Efficiency
calculateFuel Efficiency():double-the abstract method will be implemented in subclass
calculateDistance Traveled():double-the abstract method will be implemented in subclass
Where:
cargoCapacity :double
+ Truck(model: String, fuelType:String, fuel Efficiency: double,cargoCapacity :double)
+ getCargoCapacity (): double + calculateFuel Efficiency():double
+ calculateDistance Traveled():double
+ toString():String
Zoom
Truck(model: String, fuel Type: String, fuel Efficiency:
double, cargoCapacity:double) a parameterized constructor that sets values to model, fuel Type,fuel Efficiency and cargoCapacity
getCargoCapacity (): double-return the cargoCapacity
calculateFuel Efficiency():double-return the fuel efficiency (F) calculated by the following formula:F = fuel Efficiency* (1.0/ (1.0+ (cargoCapacity/1000.0)))
calculateDistance Traveled():double - return the
distance traveled (D) calculated by the following formula:
D=F* fuel Efficiency
toString():String returns truck information including values such as: model, fuel Type,fuel Efficiency, cargoCapacity. The fuel Efficiency and cargoCapacity formatted to two decimal places
Truck

+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Hương Mai
Ngày thêm
Lượt xem
4,819
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_PE01_-_FA_2024_2886.webp
File size
301.8 KB
Dimensions
1920px x 1009px

Share this media

Back
Bên trên Bottom