PRO192_-_PE01_-_SU_2025_4004.webp
white_cloud1

PRO192_-_PE01_-_SU_2025_4004.webp

☑Kizspy.me
ElectricCar is a subclass) with the following information:
- brand: String
- model: String
-year: int
+ Car()
Car
+ Car(brand: String, model: String, year:
int)
+getCarAge(currentYear: int): int
+ toString(): String
ElectricCar
Where:
Car(brand: String, model: String, year: int) - a
parameterized constructor that sets values
for brand, model, and year.
getCarAge(currentYear: int): int - return the
car's age = the current Year - the year. If the
car's age <0, return 0
⚫ toString(): String - return a string format that
contains all the information of the Car: brand,
model, year
Where:
Zoom
- batteryCapacity: int
+ ElectricCar()
+ ElectricCar(brand: String, model:
String, year: int, batteryCapacity: int)
+getEstimatedRange(speed: int): int
+toString(): String
ElectricCar(brand: String, model: String, year:
int, batteryCapacity: int) a parameterized
constructor that sets values for brand, model,
year, and batteryCapacity (the battery capacity
in kWh).
getEstimated Range(speed: int): int - return
the estimated driving range(ER) based on the
battery capacity, with ER = batteryCapacity *K,
K is calculated by the following formula:

At speed 60 (km/h) and the car can travel
5 km per kWh, K=5
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
white_cloud1
Ngày thêm
Lượt xem
3,875
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom