Resevation System
Resevation System
Project
Event Reservation System
Group Members
Abdul Moiz(23TL08)
Nishal Ali(23TL14)
Project Report: Restaurant Reservation
System
Introduction
The Restaurant Reservation System is a Java-based application developed to manage reservations
for various dining occasions, including standard dining experiences and extraordinary events like
birthdays. This system is designed to highlight the application of Object-Oriented Programming
(OOP) principles such as abstraction, encapsulation, inheritance, and polymorphism. The system
allows users to make reservations, select from a menu of food items, and calculate their total bill
based on their selections.
System Architecture
The system is composed of several Java classes, each serving a distinct role within the application.
Below is an overview of these classes and their functionalities.
Classes Overview
3. MenuItem
Reservation reservation;
if (reservationType == 2) {
reservation = makeBirthdayReservation();
} else {
// For demonstration, we use standard reservation with predetermined
details
reservation = new StandardReservation(LocalDateTime.now().plusDays(1),
4);
}
System.out.println(reservation.book());
initializeMenu();
System.out.println("\nMenu:");
displayMenu();
System.out.println("Enter the numbers of the items you'd like to order,
separated by space (e.g., 1 3 4). Press enter when done:");
String input = scanner.nextLine();
processOrder(input.split(" "));
System.out.println("Total Bill: $" + String.format("%.2f", totalBill));
}
Implementation Details
The project is implemented in Java, utilizing standard libraries for handling date and time
(java.time.LocalDateTime), user input (java.util.Scanner), and collection types (java.util.List and
java.util.ArrayList). The application follows a console-based interface for simplicity, with user
interactions managed through textual input and output.
Key Algorithms and Methods
Menu Initialization: The menu is initialized with a predefined list of MenuItem objects, each
representing a dish offered by the restaurant.
User Input Processing: User input is gathered using a Scanner object, allowing users to
specify their reservation details and select menu items.
Reservation Handling: Depending on the user's choice, the application creates either a
StandardReservation or a BirthdayReservation object and invokes its booking method.
Bill Calculation: The total bill is calculated by summing the prices of the user-selected
menu items.
User Interface
The user interface is console-based, with prompts guiding the user through the reservation and
ordering process. The interface allows for the selection of the reservation type, input of reservation
details, selection of menu items, and displays the total bill.
Output:
Conclusion
The Restaurant Reservation System effectively demonstrates the use of OOP principles to create a
modular and extendable application for managing restaurant reservations. The system provides a
simple yet functional interface for users to make reservations, select food items, and view their
total bill, highlighting the power of Java in developing real-world applications.