A terminal-based Hotel Management System developed in C++ using Object-Oriented Programming (OOP) concepts and File Handling.
This project simulates a real-world hotel ordering and management system where customers can place orders and administrators can manage inventory, monitor revenue, and track orders.
Built as a college mini project for OOP in C++. Because apparently engineering students must recreate civilization in terminals before being allowed near real software.
- View hotel menu
- Place food orders using item codes
- Quantity selection
- Real-time stock validation
- Bill calculation
- Payment handling
- Formatted receipt generation
- Timestamp on receipts
- Automatic stock updates
- Password-protected login
- View available stock
- Update inventory stock
- View all customer orders
- Calculate total revenue
| Concept | Implementation |
|---|---|
| Encapsulation | Private data members with public getters/setters |
| Inheritance | User and Admin inherit from Person |
| Polymorphism | Virtual showRole() function |
| Abstraction | Abstract base class using pure virtual function |
| Dynamic Memory | Runtime object allocation using pointers |
| Exception Handling | Input validation using try/catch |
main.cpp -> Complete source code
menu.txt -> Stores menu items and stock
orders.txt -> Stores order history and receipts
Example:
101|Margherita Pizza|250.00|10
102|Veg Burger|120.00|30
103|Pasta Alfredo|180.50|20
Format:
Code | Item Name | Price | Stock
- C++
- OOP Concepts
- File Handling (
fstream) - STL Vector
- Exception Handling
iomanipfor formattingctimefor timestamps
g++ main.cpp -o hotel.\hotelhotel.exe1. View Menu
2. Select Item Code
3. Enter Quantity
4. Make Payment
5. Generate Receipt
1. Login
2. View Stock
3. Update Stock
4. View Orders
5. Check Revenue
The system prevents:
- Invalid numeric input
- Ordering more than available stock
- Negative quantities
- Insufficient payment
The project uses text files to simulate database behavior:
- Menu data persists after program closes
- Orders are stored permanently
- Revenue can be recalculated from order history
Possible enhancements:
- GUI using Qt or SFML
- SQL database integration
- Multi-user networking
- Online ordering support
- Employee management
- Table reservation system
Person (Abstract Base Class)
├── User
└── Admin
MenuItem
Order
OrderItem
To demonstrate practical implementation of Object-Oriented Programming concepts through a real-world hotel management simulation system using C++.
This project combines OOP principles, file handling, formatted terminal interaction, and role-based system design into a practical management application.
It demonstrates how object-oriented concepts can be applied to solve real-world problems using structured and maintainable C++ code.
#Author - Anup Kumar Mishra