AJP Microproject

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Shree Ramchandra College of

Engineering

Subject – AJP

Microproject Topic:
Online Guest Reservation System using Java
Online Guest Reservation System using Java

Introduction

The "Online Guest Reservation System using Java" is a software project aimed at
creating an efficient and user-friendly online reservation system. This system
facilitates the reservation of guest accommodations through an online platform. In
recent years, online reservation systems have gained immense popularity as
businesses strive to simplify their booking processes and enhance customer
convenience. In today's fast-paced world, businesses, particularly those in the
hospitality sector, face the challenge of meeting customer demands for quick and
convenient reservations. Traditional methods often involve manual bookings,
which can be time-consuming and error-prone. To address these challenges,
businesses are increasingly turning to online reservation systems. This project
aligns with the real-world scenario where businesses seek to adapt to digital trends
and provide a more efficient booking experience. The "Online Guest Reservation
System using Java" offers several benefits for businesses such as Increased
Efficiency, Reduced Workload, Improved Customer Experience, Real-Time
Management. The core functionality of this system includes Reservation Creation,
Reservation Viewing, Reservation Cancellation.

Goal & Objectives


Goal:
The primary goal of this project is to create an online guest reservation system that simplifies the
booking process, enhances customer experience, and aids businesses in managing reservations
efficiently.

Objectives:

1)Develop a console-based Java application for making, viewing, and canceling reservations.
2)Provide a user-friendly interface for both guests and businesses.
3)Implement a reservation ID system for easy tracking and management.
4)Enable real-time reservation monitoring to improve business operations.
5)Enhance efficiency by reducing manual workload and errors in reservation management.

Intended Audiences or Beneficiaries:

The Online Guest Reservation System targets two main user groups:
Customers and Guests:
Individuals looking to make reservations at various establishments such as restaurants, hotels,
and event venues.
Users seeking a hassle-free and convenient way to book their desired services.

Business Owners and Managers:


Restaurants, hotels, and event venue managers and owners.
Professionals aiming to streamline their reservation process and enhance customer satisfaction.

Services to be provided:

The Online Guest Reservation System will offer the following key services:
Reservation Creation: Guests can easily make reservations by providing their name, desired date, and
the number of guests in their party.
Reservation Viewing: Both guests and businesses can view a list of all reservations, including
reservation details such as name, date, and number of guests.
Reservation Cancellation: Guests or businesses can cancel reservations by providing the reservation ID,
ensuring a straightforward process.
Efficient Reservation Management: Business owners can efficiently manage and monitor reservations
in real-time, allowing for improved resource allocation and customer service.
User-Friendly Interface: The system will feature an intuitive and easy-to-navigate console-based
interface to ensure a positive user experience.

Source code of the Project

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
class Reservation {
private int id;
private String name;
private String date;
private int numberOfGuests;

public Reservation(int id, String name, String date, int


numberOfGuests) {
this.id = id;
this.name = name;
this.date = date;
this.numberOfGuests = numberOfGuests;
}

public int getId() {


return id;
}

public String getName() {


return name;
}

public String getDate() {


return date;
}

public int getNumberOfGuests() {


return numberOfGuests;
}
}

class ReservationSystem {
private List<Reservation> reservations = new ArrayList<>();
private int nextId = 1;

public Reservation makeReservation(String name, String date, int


numberOfGuests) {
Reservation reservation = new Reservation(nextId++, name,
date, numberOfGuests);
reservations.add(reservation);
return reservation;
}

public List<Reservation> getReservations() {


return reservations;
}
public Reservation getReservationById(int id) {
for (Reservation reservation : reservations) {
if (reservation.getId() == id) {
return reservation;
}
}
return null;
}

public boolean cancelReservation(int id) {


Reservation reservation = getReservationById(id);
if (reservation != null) {
reservations.remove(reservation);
return true;
}
return false;
}
}

class ReservationSystemUI {
private ReservationSystem reservationSystem = new
ReservationSystem();

public void start() {


Scanner scanner = new Scanner(System.in);

while (true) {
System.out.println("1. Make a reservation");
System.out.println("2. View all reservations");
System.out.println("3. Cancel a reservation");
System.out.println("4. Exit");

int choice = scanner.nextInt();


scanner.nextLine();

switch (choice) {
case 1:
System.out.print("Name: ");
String name = scanner.nextLine();
System.out.print("Date: ");
String date = scanner.nextLine();
System.out.print("Number of guests: ");
int numberOfGuests = scanner.nextInt();
scanner.nextLine();
Reservation reservation =
reservationSystem.makeReservation(name, date, numberOfGuests);
System.out.println("Reservation made with ID " +
reservation.getId());
break;
case 2:
System.out.println("Reservations:");
for (Reservation r :
reservationSystem.getReservations()) {
System.out.println(r.getId() + " - " +
r.getName() + " - " + r.getDate() + " - " + r.getNumberOfGuests());
}
break;
case 3:
System.out.print("Reservation ID to cancel: ");
int id = scanner.nextInt();
scanner.nextLine();

if (reservationSystem.cancelReservation(id)) {
System.out.println("Reservation canceled");
} else {
System.out.println("Reservation not found");
}
break;
case 4:
return;
default:
System.out.println("Invalid choice");
}

System.out.println();
}
}

public static void main(String[] args)


{
ReservationSystemUI obj = new ReservationSystemUI();
obj.start();
}
}

You might also like