PRO192_-_PE02_-_SP_2025_3836.webp
Q

PRO192_-_PE02_-_SP_2025_3836.webp

☑Kizspy.me
- name:String
- location:String
Store
-inventoryCount: int
-capacity Limit:int
+ Store(name:String, location:String,
inventoryCount: int, capacity Limit:int)
+ getName():String
+getAvailableCapacity():int
+toString()):String
Where:


location,
If
Store(name:String, location:String, inventoryCount:
int, capacity Limit:int) - parameterized constructor,
which
sets
values to name,
inventoryCount, and capacity Limit.
inventoryCount is less than 50 then set it to 50
getName():String return the name in uppercase
format if its length is at least 5 characters; otherwise
return "N/A".
⚫ getAvailableCapacity():int return the available
capacity with available capacity capacity Limit -
inventoryCount. If capacity Limit is less than
inventoryCount then set it to inventoryCount * 5
then calculate the available capacity.
• Override toString():String - return a string format
that contains all the information of the store: name-
location-inventoryCount-capacity Limit. If
capacity Limit is less than inventoryCount then set
it to inventoryCount * 5
Zoom
Do not format the result.
The program output might look something like this:
Enter name:My Shop
+100%
Enter name: My Shop
Enter name: My Shop
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Quốc Khánh1
Ngày thêm
Lượt xem
9,236
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom