This is a simple inventory management system that tracks products, stocks, and orders. The system allows you to:
- Define products with names and prices
- Track product quantities in different stocks (Deposit, Warehouse, Shop)
- Create and process orders for products
- Monitor stock levels after order processing
Product.h/cpp: Defines the Product class with name, price, and unique IDStock.h/cpp: Manages collections of products and their quantitiesOrder.h/cpp: Handles customer orders and order processingmain.cpp: Main program that reads data from file and processes itdata.txt: Input file with products, stocks, and orders
- Define your products, stocks, and orders in the
data.txtfile - Compile and run the program
The data.txt file follows this format:
# Products
# Format: PRODUCT_NAME PRICE
PRODUCT Apple 2.5
PRODUCT Banana 4.0
# Stocks
# Format: STOCK STOCK_NAME PRODUCT_NAME QUANTITY
STOCK Deposit Apple 200
STOCK Warehouse Apple 100
# Orders
# Format: ORDER ORDER_DATE STORE_NAME PRODUCT_NAME QUANTITY
ORDER 2024-03-20 Store1 Apple 10
To compile the program:
g++ -std=c++11 main.cpp -o inventory_system
To run the program:
./inventory_system
- Object-oriented design with proper encapsulation
- File-based data input
- Automatic unique ID assignment for products, stocks, and orders
- Stock quantity validation during order processing
- Total price calculation for orders
- Console-based reporting of stock levels and order processing
The program will display:
- List of all products
- Current stock levels
- All orders
- Updated stock levels after processing orders