Use your OOP skills — classes, constructors, and inheritance — to build a product inventory tracker. You'll model real-world items as objects.
YOUR TASK
Create a program that:
Defines a Product class with Name, Price, and Quantity
Has a constructor that sets all three fields
Has a Display() method that prints item details
Creates at least 2 products and calls Display() on each
Prints the total inventory value (price × quantity summed)
Need a hint?
Structure:
1. Define class Product outside Main
2. Constructor: public Product(string name, double price, int qty)
3. Display(): print name, price, quantity
4. In Main: create list of products, loop + display, sum values
5. totalValue += p.Price * p.Quantity;
Expected output:
Laptop - $999.99 x 5
Mouse - $29.99 x 20
Total inventory value: $5599.75
Code Editor
Ready
Output
Console
Console initialized...
Ready for Project 2: Inventory System
> Test your code with the "Check My Code" button
> When it passes, the Complete button will activate!