Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Hotel Management System 🍽️🏨

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.


🚀 Features

👤 Customer Mode

  • 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

🔐 Admin Mode

  • Password-protected login
  • View available stock
  • Update inventory stock
  • View all customer orders
  • Calculate total revenue

🧠 OOP Concepts Used

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

📂 Files Used

main.cpp      -> Complete source code
menu.txt      -> Stores menu items and stock
orders.txt    -> Stores order history and receipts

📋 Menu File Format

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

🛠️ Technologies Used

  • C++
  • OOP Concepts
  • File Handling (fstream)
  • STL Vector
  • Exception Handling
  • iomanip for formatting
  • ctime for timestamps

▶️ How to Run

Compile

g++ main.cpp -o hotel

Run

Windows PowerShell

.\hotel

CMD

hotel.exe

🧾 Sample Features Demonstration

Customer Flow

1. View Menu
2. Select Item Code
3. Enter Quantity
4. Make Payment
5. Generate Receipt

Admin Flow

1. Login
2. View Stock
3. Update Stock
4. View Orders
5. Check Revenue

🔒 Input Validation

The system prevents:

  • Invalid numeric input
  • Ordering more than available stock
  • Negative quantities
  • Insufficient payment

💾 Data Persistence

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

📈 Future Improvements

Possible enhancements:

  • GUI using Qt or SFML
  • SQL database integration
  • Multi-user networking
  • Online ordering support
  • Employee management
  • Table reservation system

🏗️ Class Structure

Person (Abstract Base Class)
├── User
└── Admin

MenuItem
Order
OrderItem

🎯 Project Objective

To demonstrate practical implementation of Object-Oriented Programming concepts through a real-world hotel management simulation system using C++.


📌 Conclusion

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

About

A terminal-based Hotel Management System built in C++ using OOP concepts and file handling. Features include menu ordering, payment, receipt generation, stock management, admin authentication, and revenue tracking with persistent data storage using text files.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages