Built using Java β’ Object-Oriented Programming β’ File Handling β’ Collections Framework
A modular Java console application that simulates a real-world hotel reservation workflow including customer registration, room booking, payment processing, reservation management, and persistent data storage.
The ABC Hotel Reservation System is a console-based Java application developed using Object-Oriented Programming (OOP) principles.
The project simulates the workflow of a real hotel reservation system where customers can register, check room availability, reserve rooms for selected dates, complete payments using multiple payment methods, cancel reservations, and view booking history.
The application follows a modular architecture with separate packages for models, services, storage, and utilities, making the code clean, reusable, and easy to maintain.
Instead of using a database, all data is stored in text files, allowing customer details, reservations, rooms, and payments to persist between application executions.
- View all hotel rooms
- View available rooms
- Date-wise room availability
- Room category management
- Capacity information
- Price per night
- Room status tracking
- New customer registration
- Existing customer detection using phone number
- Automatic Customer ID generation
- Phone number validation
- Book hotel rooms
- Check room availability
- Date conflict detection
- Reservation confirmation
- Reservation history
- Reservation cancellation
- Automatic Reservation ID generation
Supported payment methods:
- π΅ Cash
- π± UPI
- π³ Card
Features include:
- Payment validation
- Payment receipt generation
- Payment status tracking
- Automatic Payment ID generation
The application stores all information using text files.
data/
β
βββ customers.txt
βββ rooms.txt
βββ reservations.txt
βββ payments.txt
Whenever the application starts, all records are automatically loaded from these files.
The application includes comprehensive validation to prevent invalid inputs and unexpected crashes.
- Invalid menu choice
- Non-numeric input
- Empty customer name
- Invalid phone number
- Existing customer detection
- Invalid room number
- Invalid check-in date
- Invalid check-out date
- Past date restriction
- Date conflict detection
- Room availability verification
- Invalid amount
- Insufficient payment
- Change calculation
- UPI ID format validation
- Card holder validation
- Card number validation
- Expiry validation
- CVV validation
- PIN validation
- Invalid Reservation ID
- Already cancelled reservation
| Technology | Purpose |
|---|---|
| Java | Core Programming Language |
| Object-Oriented Programming | Software Design |
| Java Collections | Data Management |
| Java Time API | Date & Time Handling |
| Java File Handling | Persistent Storage |
| Exception Handling | Error Handling |
| IntelliJ IDEA | Development Environment |
| Git | Version Control |
| GitHub | Project Hosting |
Main
β
βΌ
Reservation Service
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
βΌ βΌ βΌ
Room Service Booking Service Payment Service
β β β
βββββββββββββββββββββββΌββββββββββββββββββββββ
βΌ
Storage Layer
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
βΌ βΌ βΌ
Customer Repo Reservation Repo Payment Repo
Customer Registration
β
βΌ
Select Check-In & Check-Out Dates
β
βΌ
Check Room Availability
β
βΌ
Select Room
β
βΌ
Create Reservation
β
βΌ
Payment
(Cash / UPI / Card)
β
βΌ
Generate Receipt
β
βΌ
Save Reservation
CodeAlpha_HotelReservationSystem
β
βββ data
β βββ customers.txt
β βββ rooms.txt
β βββ reservations.txt
β βββ payments.txt
β
βββ screenshots
β βββ welcome-screen.png
β βββ all-rooms.png
β βββ available-rooms.png
β βββ booking-details.png
β βββ payment-selection.png
β βββ payment-receipt.png
β βββ view-reservations.png
β βββ cancellation-confirmation.png
β βββ room-available-after-cancellation.png
β βββ exit-screen.png
β
βββ src
β βββ model
β βββ service
β βββ storage
β βββ util
β βββ Main.java
β
βββ README.md
βββ .gitignore
The application starts with a welcome screen displaying the hotel name, loading sequence, current date and time, followed by the main menu.
Displays all available hotel rooms along with:
- Room Number
- Room Category
- Price Per Night
- Capacity
- Room Status
- Description
Displays only rooms that are currently available for booking based on their reservation status.
The booking module allows customers to:
- Register new customers
- Detect existing customers
- Select check-in and check-out dates
- Check room availability
- Create reservations
The system prevents overlapping reservations by validating booking dates before confirmation.
After a reservation is created, users can choose one of the supported payment methods:
- Cash
- UPI
- Card
Each payment option includes validation to ensure accurate and secure input.
A detailed payment receipt is generated after successful payment containing:
- Reservation ID
- Customer Name
- Room Number
- Room Category
- Booking Dates
- Amount Paid
- Payment Method
- Transaction ID
- Transaction Date & Time
Displays all reservation records including:
- Reservation ID
- Customer Details
- Room Information
- Booking Dates
- Payment Status
- Reservation Status
Allows users to cancel an existing reservation using the Reservation ID.
The system validates:
- Reservation existence
- Reservation status
before cancellation.
Once a reservation is cancelled, the room becomes available again for future bookings.
The application updates the room availability automatically without requiring a restart.
Displays a simple thank-you message before closing the application.
Before running the project, ensure you have:
- Java JDK 17 or above
- IntelliJ IDEA (Recommended)
- Git (Optional)
git clone https://github.com/ADHEMANTH/CodeAlpha_HotelReservationSystem.gitOpen the project using IntelliJ IDEA.
Execute the following file:
Main.java
The application automatically creates the required data files if they do not exist.
=========================================
ABC HOTEL RESERVATION
=========================================
1. View All Rooms
2. View Available Rooms
3. Book Room
4. Cancel Reservation
5. View Reservations
6. Exit
This project demonstrates the practical implementation of:
- Classes and Objects
- Encapsulation
- Abstraction
- Composition
- Enums
- Utility Classes
- Modular Design
- Layered Architecture
- Separation of Concerns
- Constructors
- Static Methods
- Method Overloading
- Java Collections Framework (
ArrayList) - Java Time API (
LocalDate,LocalDateTime) - Exception Handling
- File Handling
- Regular Expressions
- Input Validation
- Package Organization
Developing this project helped strengthen practical knowledge of:
- Object-Oriented Programming
- Java Collections Framework
- File Handling
- Exception Handling
- Java Time API
- Clean Code Practices
- Modular Application Development
- Input Validation
- Reservation Management Logic
- Payment Processing Workflow
- Persistent Data Storage
The project can be further enhanced by implementing the following features:
- π MySQL Database Integration
- π Spring Boot REST API
- π₯ JavaFX Desktop GUI
- π€ User Authentication & Login System
- π Admin Dashboard
- π§ Email Booking Confirmation
- π³ Online Payment Gateway Integration
- π Reservation Reports
- π Search & Filter Rooms
- π¨ Multi-Hotel Support
- β Customer Feedback & Ratings
- π± Mobile Application Support
β Console-Based Hotel Reservation System
β Object-Oriented Programming Architecture
β Layered Project Structure
β Customer Registration & Management
β Automatic Customer ID Generation
β Dynamic Room Availability
β Date Conflict Detection
β Reservation Management
β Reservation Cancellation
β Payment Processing
β Payment Receipt Generation
β Persistent File Storage
β Robust Input Validation
β Exception Handling
β Clean & Modular Code
β User-Friendly Console Interface
This project was developed to simulate the workflow of a real-world hotel reservation system while applying core Java programming concepts.
It demonstrates how Object-Oriented Programming, modular architecture, collections, file handling, and input validation can be combined to build a practical and maintainable application.
The focus was not only on implementing functionality but also on writing clean, reusable, and well-organized code that can be extended in the future.
- Develop a modular hotel reservation application using Java.
- Apply Object-Oriented Programming principles effectively.
- Implement persistent storage using text files.
- Validate user inputs to prevent invalid operations.
- Simulate a complete hotel booking workflow.
- Improve problem-solving and software design skills.
- Java Programming
- Object-Oriented Programming
- Exception Handling
- File Handling
- Collections Framework
- Layered Architecture
- Modular Design
- Utility Classes
- Separation of Concerns
- Reservation Logic
- Date Conflict Detection
- Input Validation
- Payment Workflow
- Data Persistence
This project was developed for learning purposes as part of the CodeAlpha Java Programming Internship.
You are free to explore, modify, and learn from the source code for educational purposes.
B.Tech β Electrical & Electronics Engineering
Passionate about Java Development, Software Engineering, and building practical applications using Object-Oriented Programming principles.
This project was developed as part of the CodeAlpha Java Programming Internship.
It provided an opportunity to apply Java programming concepts to build a complete console-based Hotel Reservation Management System while improving software design, coding practices, and problem-solving skills.
Thank you for taking the time to explore this project.
I hope this project demonstrates my understanding of Java programming, Object-Oriented Programming, file handling, modular application development, and clean coding practices.
Feedback and suggestions are always welcome.
Happy Coding! π
The following screenshots demonstrate the complete workflow of the Hotel Reservation System, from launching the application to booking, payment, reservation management, and cancellation.









