☑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