Lesson 8 of 8Article22 min
Mini Project - Inventory Manager
Mini Project - Inventory Manager
Project goals
- Create Product class with id, name, and quantity.
- Use vector to manage product list.
- Search, update stock, and print summaries.
- Save/load inventory from a file.
Starter project skeleton
Inventory model
#include <iostream>
#include <vector>
#include <string>
using namespace std;
struct Product {
int id;
string name;
int quantity;
};
int main() {
vector<Product> items = {{1, "Keyboard", 20}, {2, "Mouse", 50}};
for (const auto& item : items) {
cout << item.id << " " << item.name << " " << item.quantity << endl;
}
}