Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 ABC Hotel Reservation System

Console-Based Hotel Reservation Management Application

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.


πŸ“– About the Project

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.


✨ Key Features

🏨 Room Management

  • View all hotel rooms
  • View available rooms
  • Date-wise room availability
  • Room category management
  • Capacity information
  • Price per night
  • Room status tracking

πŸ‘€ Customer Management

  • New customer registration
  • Existing customer detection using phone number
  • Automatic Customer ID generation
  • Phone number validation

πŸ“… Reservation Management

  • Book hotel rooms
  • Check room availability
  • Date conflict detection
  • Reservation confirmation
  • Reservation history
  • Reservation cancellation
  • Automatic Reservation ID generation

πŸ’³ Payment Module

Supported payment methods:

  • πŸ’΅ Cash
  • πŸ“± UPI
  • πŸ’³ Card

Features include:

  • Payment validation
  • Payment receipt generation
  • Payment status tracking
  • Automatic Payment ID generation

πŸ’Ύ Persistent Storage

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.


πŸ›‘ Input Validation

The application includes comprehensive validation to prevent invalid inputs and unexpected crashes.

Menu Validation

  • Invalid menu choice
  • Non-numeric input

Customer Validation

  • Empty customer name
  • Invalid phone number
  • Existing customer detection

Reservation Validation

  • Invalid room number
  • Invalid check-in date
  • Invalid check-out date
  • Past date restriction
  • Date conflict detection
  • Room availability verification

Payment Validation

Cash

  • Invalid amount
  • Insufficient payment
  • Change calculation

UPI

  • UPI ID format validation

Card

  • Card holder validation
  • Card number validation
  • Expiry validation
  • CVV validation
  • PIN validation

Cancellation Validation

  • Invalid Reservation ID
  • Already cancelled reservation

βš™ Technologies Used

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

πŸ— System Architecture

                           Main
                            β”‚
                            β–Ό
                 Reservation Service
                            β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β–Ό                     β–Ό                     β–Ό
 Room Service       Booking Service      Payment Service
      β”‚                     β”‚                     β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
                     Storage Layer
                            β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β–Ό                     β–Ό                     β–Ό
 Customer Repo      Reservation Repo      Payment Repo

πŸ”„ Application Workflow

Customer Registration
          β”‚
          β–Ό
Select Check-In & Check-Out Dates
          β”‚
          β–Ό
Check Room Availability
          β”‚
          β–Ό
Select Room
          β”‚
          β–Ό
Create Reservation
          β”‚
          β–Ό
Payment
(Cash / UPI / Card)
          β”‚
          β–Ό
Generate Receipt
          β”‚
          β–Ό
Save Reservation

πŸ“‚ Project Structure

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

πŸ“Έ Application Screenshots

🏠 Welcome Screen

Welcome Screen

The application starts with a welcome screen displaying the hotel name, loading sequence, current date and time, followed by the main menu.


🏨 View All Rooms

All Rooms

Displays all available hotel rooms along with:

  • Room Number
  • Room Category
  • Price Per Night
  • Capacity
  • Room Status
  • Description

🟒 View Available Rooms

Available Rooms

Displays only rooms that are currently available for booking based on their reservation status.


πŸ“… Booking Process

Booking Details

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.


πŸ’³ Payment Selection

Payment Selection

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.


🧾 Payment Receipt

Payment Receipt

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

πŸ“‹ Reservation History

View Reservations

Displays all reservation records including:

  • Reservation ID
  • Customer Details
  • Room Information
  • Booking Dates
  • Payment Status
  • Reservation Status

❌ Reservation Cancellation

Cancellation

Allows users to cancel an existing reservation using the Reservation ID.

The system validates:

  • Reservation existence
  • Reservation status

before cancellation.


βœ… Room Available After Cancellation

Room Available Again

Once a reservation is cancelled, the room becomes available again for future bookings.

The application updates the room availability automatically without requiring a restart.


πŸ‘‹ Exit Screen

Exit Screen

Displays a simple thank-you message before closing the application.


πŸš€ Getting Started

Prerequisites

Before running the project, ensure you have:

  • Java JDK 17 or above
  • IntelliJ IDEA (Recommended)
  • Git (Optional)

Clone the Repository

git clone https://github.com/ADHEMANTH/CodeAlpha_HotelReservationSystem.git

Open the Project

Open the project using IntelliJ IDEA.


Run the Application

Execute the following file:

Main.java

The application automatically creates the required data files if they do not exist.


πŸ“‹ Main Menu

=========================================
        ABC HOTEL RESERVATION
=========================================

1. View All Rooms

2. View Available Rooms

3. Book Room

4. Cancel Reservation

5. View Reservations

6. Exit

🧠 Object-Oriented Programming Concepts Used

This project demonstrates the practical implementation of:

  • Classes and Objects
  • Encapsulation
  • Abstraction
  • Composition
  • Enums
  • Utility Classes
  • Modular Design
  • Layered Architecture
  • Separation of Concerns

πŸ“š Java Concepts Implemented

  • Constructors
  • Static Methods
  • Method Overloading
  • Java Collections Framework (ArrayList)
  • Java Time API (LocalDate, LocalDateTime)
  • Exception Handling
  • File Handling
  • Regular Expressions
  • Input Validation
  • Package Organization

🎯 Learning Outcomes

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

πŸš€ Future Enhancements

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

🌟 Project Highlights

βœ” 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


πŸ’‘ Why This Project?

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.


πŸ“Œ Project Objectives

  • 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.

πŸŽ“ Skills Demonstrated

Programming

  • Java Programming
  • Object-Oriented Programming
  • Exception Handling
  • File Handling
  • Collections Framework

Software Design

  • Layered Architecture
  • Modular Design
  • Utility Classes
  • Separation of Concerns

Problem Solving

  • Reservation Logic
  • Date Conflict Detection
  • Input Validation
  • Payment Workflow
  • Data Persistence

πŸ“„ License

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.


πŸ‘¨β€πŸ’» Author

A. D. Hemanth

B.Tech – Electrical & Electronics Engineering

Passionate about Java Development, Software Engineering, and building practical applications using Object-Oriented Programming principles.


🀝 Acknowledgement

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

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.


⭐ If you found this project helpful, consider giving it a Star!

Thank you for visiting the ABC Hotel Reservation System repository.

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.

About

Java Console Based Hotel Reservation System using Object-Oriented Programming and File Handling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages