A lightweight, console-based C++ application designed to handle meal bookings for cafeterias, dining halls, or hostels. This system features user authentication, dynamic menu selection, and persistent file-based storage for managing daily lunch and dinner orders.
- User Authentication: Secure sign-up and login functionality. User credentials are saved locally to prevent unauthorized access.
- Menu Browsing & Selection: Users can view separate menus for Lunch and Dinner, featuring items like Chicken Curry, Beef Curry, and Fish Fry.
- Automated Billing: Automatically calculates the total cost of the meal, factoring in a base dining fixed cost plus the prices of individual selected items.
- Order Management: * Book a Meal: Save order details including name, selected items, hall, and precise timestamp.
- Search Bookings: Quickly retrieve order details by querying the user's name.
- Cancel Bookings: Remove existing orders from the system easily.
- Persistent Storage: Utilizes C++ file handling (
fstream) to save all users tousers.txtand all active orders tobookings.txt. Bookings are automatically sorted chronologically. - Cross-Platform UI: Includes pre-processor directives to cleanly clear the console on both Windows (
cls) and Unix/Linux/macOS (clear) environments.
- Language: C++ (C++11 or higher recommended)
- Standard Template Library (STL): Utilizes
std::vector,std::map, andstd::unordered_mapfor efficient data handling and menu sorting. - File I/O:
std::ifstreamandstd::ofstreamfor persistent data management. - Time Library:
<ctime>for generating real-time booking timestamps.
You will need a C++ compiler installed on your system, such as GCC (g++) or MSVC.
- Clone this repository to your local machine:
git clone https://github.com/YourUsername/Meal-Order-Management-System.git
- Navigate to the project directory:
cd Meal-Order-Management-System - Compile the source code using
g++:g++ main.cpp -o MealSystem
- Run the compiled executable:
- On Windows:
MealSystem.exe
- On Linux/macOS:
./MealSystem
- On Windows:
main.cpp: The core application code containing all classes (User,Authentication,MealBookingSystem) and application logic.users.txt: (Auto-generated) Stores registered usernames and passwords.bookings.txt: (Auto-generated) Stores all active meal bookings in a comma-separated format.temp.txt: (Temporary) Used briefly by the system during the cancellation process to safely update the bookings list.
- Launch the app and select Sign Up to create an account.
- Log In using your newly created credentials.
- Select Book a Meal, input your name, choose between Lunch or Dinner, and enter the item numbers you wish to eat (separated by spaces).
- Enter your designated hall. The system will print a detailed receipt with your total cost.
- Use the main menu to Search or Cancel your booking if your plans change.