PRO192_-_PE01_-_SP_2025_3490.webp
BichPhuong97

PRO192_-_PE01_-_SP_2025_3490.webp

☑Kizspy.me
-id: int
name: String
- capacity: double
- maxWeight: int
+ Suitcase()
+ Suitcase(id:int, name:String,
capacity:double, maxWeight:int)
+ getters & setters
+ expandSuitcase():double
+ toString():String
Suitcase () default constructor
⚫ Suitcase(id:int, name:String, capacity:double,
maxWeight:int) parameterized constructor that sets
values for id, name, capacity, and maxWeight.

-
getters & setters: write the setters and getters of the
fields
⚫ expandSuitcase():double - return the new capacity(NC)
by increases the suitcase's capacity based on its
maxWeight:
■ If maxWeight is >= 15, NC = capacity +5
"
If 7 <maxWeight <15, NC = capacity +2
"
If maxWeight is <= 7, NC = capacity +0
⚫ toString(): String-return a string format containing
all the information of the Suitcase: id, name,
capacity, maxWeight. The capacity is formatted in
two decimal places, the name in uppercase format.
Zoom
+ 100%
Do not format the result.
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom