PRF193_PE_SU25_521364_3993.webp
H

PRF193_PE_SU25_521364_3993.webp

☑Kizspy.me
- model: string
brand: string
- price: int
quantity: int
+ Laptop (id: string, model: string,
brand: string, price: int, quantity: int)
+ getTotalValue(): int
+printInfo(): void

int, quantity: int) - parameterized constructor: set
the values to the id, model, brand, price and
quantity.
getTotalValue():int-return the value of total laptop
with formular: totalValue = price* quantity
printInfo():void Print all the information of the
Laptop: id, model, brand, price, quantity.
Hints:
We can use the to_string() in the string library to convert int to string
Notes:
- You can create new function(s) if you see it is necessary.
-Do not edit given statements in the main function.
Sample input and output:
Enter laptop id: A123
Enter laptop model: DV9000
Enter laptop brand: HPE
Enter price: 1400
Enter quantity: 2
1. Test printInfo()
2. Test getTotalValue()
Enter TC(1/2):1
Output for marking
Enter laptop id: A123
Enter laptop model: DV9000
Enter laptop brand: HPE
Enter price: 1200
Enter quantity: 3
1. Test printinfo()
2. Test getTotalValue()
Enter TC(1/2):2
Output for marking
Zoom
+ 100%
Activate Windows
Go to Settings to activate Windows.
Close
Chưa có bình luận nào.

Thông tin

Category
PRF193
Thêm bởi
hoangphuc76
Ngày thêm
Lượt xem
732
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom