☑Kizspy.me
4 of 4
Paper No: 1
-id: string
- model: string
brand: string
- price: int
- quantity: int
.
•
Laptop(id:string, model:string, brand: String, price:
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.
+Laptop (id: string, model: string,
brand: string, price: int, quantity: int)
+ getTotalValue(): int
+ printInfo(): void
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 lanton id: A123
Enter lanton id: 4123
Zoom
+ 100%
Activate Windows
Go to Settings to activate Windows.
Close