You are on page 1of 14

B M S COLLEGE OF ENGINEERING

(An Autonomous Institution Affiliated to VTU, Belagavi)


Post Box No.: 1908, Bull Temple Road, Bengaluru – 560 019
DEPARTMENT OF MACHINE LEARNING
Academic Year: 2022-2023 (Session: November 2022-February 2023)

SOFTWARE ENGINEERING AND DESIGN PATTERNS


(22AM5PCSED)
ALTERNATIVE ASSESSMENT TOOL (AAT)

HOTEL MANAGEMENT
Submitted by
Student Name:
Team Member 1: Mohamed Moyiz Khan

Team Member 2: Aparna R Pai

USN:
Team Member 1: 1BM20AI069

Team Member 2: 1BM20AI012

Semester & Section: 5A

Student Signature:
Team Member 1:

Team Member 2:

Valuation Report (to be filled by the faculty)

Score: Faculty In-charge: Dr. Sandeep Varma N

Faculty Signature:
Comments:
with date
ABSTRACT

Hotel Management System is a crucial part of the hospitality industry and plays a significant
role in maintaining the day-to-day operations of a hotel. This system aims to automate
various processes such as room booking, billing, and inventory management. In this project,
we propose the development of a Hotel Management System using the Java programming
language. Java was chosen for its robustness, versatility, and platform-independent nature.

The system will have a user-friendly interface, making it accessible to hotel staff with
varying levels of technical expertise. The system will also have security features to ensure the
protection of sensitive information such as guest details and financial transactions.

The system will automate the booking process by allowing guests to check availability and
book rooms online. It will also provide real-time updates on room status, allowing hotel staff
to quickly respond to guest requests and allocate rooms efficiently. The billing process will
be streamlined, reducing the time and effort required to process payments and generate
invoices. The inventory management module will keep track of hotel supplies, reducing the
risk of stock shortages and ensuring that guests have access to the amenities they need.

In conclusion, the Hotel Management System developed using Java will provide a
comprehensive solution to the various challenges faced by hotels in managing their
operations. It will increase efficiency, improve guest satisfaction, and provide valuable
insights into hotel performance, helping hotel managers make informed business decisions.

1
TABLE OF CONTENTS

CHAPTER
TITLE PAGE NO.
NO.

ABSTRACT 1

TABLE OF CONTENTS 2

LIST OF FIGURES 3

INTRODUCTION 4

1.1 Use Case Diagram 5

1.2 Class Diagram 6

2.1 Activity Diagram 7-8

2.2 Stage Diagram 9-10

3 Missing Requirements 10

4 Java Code Snippets and Output 11-13

2
LIST OF FIGURES

CHAPTER
TITLE PAGE NO.
NO.

1.1 Use Case Diagram 5

1.2 Class Diagram 6

2.1 Activity Diagram 8

2.2 Stage Diagram 9

3 Output 13

3
INTRODUCTION

Hotel Management System is a software solution designed to streamline the operations of


hotels and improve guest experience. With the growth of the hospitality industry, there has
been an increasing demand for efficient and effective systems to manage the day-to-day
activities of hotels. A Hotel Management System using Java programming language is an
excellent solution for hotels looking to improve their operations.

Java is a popular programming language known for its robustness, versatility, and platform-
independent nature. This makes it an ideal choice for developing a Hotel Management
System that can run on multiple platforms, including desktop and mobile devices. The system
will have a user-friendly interface and will provide various modules to automate various hotel
processes such as room booking, billing, and inventory management.

The Hotel Management System will make it easier for guests to check room availability,
book rooms online, and receive real-time updates on their reservation. The billing process
will be streamlined, reducing the time and effort required to process payments and generate
invoices. The inventory management module will ensure that the hotel is adequately stocked,
reducing the risk of stock shortages and ensuring that guests have access to the amenities they
need.

4
1.1. Use Case Diagram
Use case diagrams are a type of visual representation used in the field of software
engineering and systems analysis. They are used to capture and depict the functional
requirements of a system and show how the various actors within the system interact with
each other to achieve specific goals. A use case diagram typically consists of several
elements, including actors, use cases, and relationships. Actors represent the individuals or
systems that interact with the system being analyzed. Use cases represent the specific goals or
functions that the actors can perform within the system. Relationships between actors and use
cases, such as includes and extends, are depicted using lines or arrows.

Fig. 1.1. Use Case Diagram

5
1.2. Class Diagram
A class diagram in UML (Unified Modeling Language) is a type of diagram that represents
the classes and objects in a system, and the relationships between them. A class is a blueprint
or template that defines the attributes and behaviors of objects in a system. Objects are
instances of classes, and they represent the real-world entities in a system.

Fig. 1.2. Class Diagram

6
2.1. Activity Diagram

An activity diagram in UML (Unified Modeling Language) is a type of flowchart that


represents the flow of activities in a system. It is used to model the steps involved in a
process or the interactions between different elements in a system. An activity diagram is
similar to a flowchart, but it is more detailed and includes additional elements to represent the
flow of control and the relationships between different activities.

In an activity diagram, activities are represented as rounded rectangles, and the flow between
activities is depicted using arrows. The arrows show the order in which activities are
performed, and the relationships between different activities. Activity diagrams can also
include decision points, represented as diamonds, which are used to model conditional flows
in the system.

7
Fig. 2.1. Activity Diagram

Activity diagrams can be used to model a wide range of processes, including business
processes, software processes, and system processes. They are useful for representing
complex processes and for visualizing the flow of activities in a system. By using activity
diagrams, it is possible to identify potential issues and bottlenecks in a process, and to make
improvements to the flow of activities.

2.2 Sequence Diagram


8
A sequence diagram in UML (Unified Modeling Language) is a type of interaction diagram
that represents the interactions between objects or components in a system over time. It
shows the order in which messages are sent and received between objects, and the
relationships between objects.

Fig. 2.2. Sequence Diagram

In a sequence diagram, objects are represented as horizontal lines, and the interactions
between objects are depicted as vertical arrows. The arrows show the flow of messages
between objects, and the order in which they are sent and received. The sequence diagram
can also include lifelines, which represent the objects' existence over time, and activation
bars, which represent the amount of time an object is performing an action.

Sequence diagrams are particularly useful for representing complex interactions between
objects, and for visualizing the flow of messages between objects. They can be used to model

9
the interactions between objects in a system, to identify potential issues, and to make
improvements to the design of a system.

3. Identifing any missing requirements or you can think of those


which the client is missing and that are the most important ones and
you can incorporate the same.

1.Hotel provided managemental services like wifi , parking


reservations, free coffee and sanitation.

2. Customers are now given an increase in stay at the


hotel and extend their duration of stay.

3.Hotel trying to give complimentary breakfast and


other complimentary services to the guests that
enhance the hotels quality for eg- offering free
parking, free and speedy wifi etc.

4.Maintaining a track record of customers expenditure at


the resort like total bill including room services , stuff they
took from the mini bar of the resort, massages from the
massage parlor located at the top of the hotel.

The code :

import java.util.Scanner;

public class HotelReservation {


  private static Scanner sc = new Scanner(System.in);
  private static Room[] rooms = new Room[10];
  
10
  public static void main(String[] args) {
    initializeRooms();
    
    while (true) {
      System.out.println("1. View all rooms");
      System.out.println("2. Reserve a room");
      System.out.println("3. Cancel reservation");
      System.out.println("4. Exit");
      System.out.print("Enter your choice: ");
      
      int choice = sc.nextInt();
      switch (choice) {
        case 1:
          viewRooms();
          break;
        case 2:
          reserveRoom();
          break;
        case 3:
          cancelReservation();
          break;
        case 4:
          System.exit(0);
        default:
          System.out.println("Invalid choice. Try again.");
      }
    }
  }
  
  private static void initializeRooms() {
    for (int i = 0; i < 10; i++) {
      rooms[i] = new Room(i + 1);
    }
  }
  
  private static void viewRooms() {
    System.out.println("Room No\tAvailability");
    for (Room room : rooms) {
      System.out.println(room.getRoomNumber() + "\t\t" + (room.isAvailable() ?
"Available" : "Not Available"));
    }
  }
  
  private static void reserveRoom() {
    System.out.print("Enter room number: ");
    int roomNumber = sc.nextInt();
    if (roomNumber < 1 || roomNumber > 10) {
      System.out.println("Invalid room number. Try again.");
      return;
    }
    

11
    Room room = rooms[roomNumber - 1];
    if (!room.isAvailable()) {
      System.out.println("Room not available. Try another room.");
      return;
    }
    
    room.setAvailable(false);
    System.out.println("Room reserved successfully!");
  }
  
  private static void cancelReservation() {
    System.out.print("Enter room number: ");
    int roomNumber = sc.nextInt();
    if (roomNumber < 1 || roomNumber > 10) {
      System.out.println("Invalid room number. Try again.");
      return;
    }
    
    Room room = rooms[roomNumber - 1];
    if (room.isAvailable()) {
      System.out.println("Room is already available.");
      return;
    }
    
    room.setAvailable(true);
    System.out.println("Reservation cancelled successfully!");
  }
}

class Room {
  private int roomNumber;
  private boolean available;
  
  public Room(int roomNumber) {
    this.roomNumber = roomNumber;
    this.available = true;
  }
  
  public int getRoomNumber() {
    return roomNumber;
  }
  
  public boolean

The Output:

12
Fig. 3. Output

13

You might also like