Mini Software Isc
Mini Software Isc
SOFTWARE
On Hotel Management
- developed by Rajiv
Seth
CONTENTS:
EXPECTED OUTPUT:
This Java program simulates a hotel management
system for booking rooms at "Hotel Red Star" in
Singapore. Below is a summary of the expected output:
1. **Welcome Message:**
- The program starts with an ASCII art welcome message
showcasing the hotel name and a description of the hotel,
emphasizing its heritage and luxury.
2. **Booking Process:**
- The user is asked if they want to book a room at the hotel.
- If they agree, they are prompted to input the date of visit
and the number of days they plan to stay.
3. **Room Selection:**
- The user is presented with four types of rooms to choose
from: King Suite, Queen Suite, AC Deluxe, and Non-AC Deluxe.
- A room description (features, size, bed options, etc.) is
displayed for each room.
- The user can select the room they prefer or choose to go
back to the menu if the initial choice doesn't work.
- After selecting the room type, the program simulates
checking for room availability and assigns a room number.
4. **Registration Process:**
- The user is asked to provide their personal information
including name, gender, address, occupation, purpose of visit,
number of rooms booked, and the number of adults and
children.
- They are also asked if they wish to have complimentary
breakfast, with an option to select "yes" or "no".
5. **Billing Calculation:**
- The program calculates the bill based on the room type,
number of days, number of people, and optional breakfast.
- Additional charges may apply based on the number of
adults exceeding the room capacity and the number of
children.
- A tax calculation is performed to include service tax and
VAT.
- The program displays the total gross amount, taxes, and net
amount to be paid.
HARDWARE USED:
Device name:HP Pavillion Laptop
Processor: AMD Ryzen 5 5500U with Radeon
Graphics - 2.10 GHz
Installed RAM: 16.0 GB (15.3 GB usable)
System type: 64-bit operating system, x64-based
processor
PRINTER:
HP Ink Tank 115
SOFTWARE USED:
BlueJ Version – 5.4.1
Java Version – JDK 23
METHODOLOGY:
Below are the functions used in the
`Hotel_Management` system along with their
explanations:
1. **`main()`**
- **Purpose**: The main entry point of the program.
- **Usage**: It prints a welcome message, initializes the
`Hotel_Management` object, and calls the following methods:
`input()`, `roomBook()`, `registration()`, and `billCalc()`.
2. **`input()`**
- **Purpose**: This method is used to gather basic
information about the customer, such as the date of visit and
the number of days they will stay.
- **Usage**: Asks the user for input regarding the date and
duration of their stay. It then confirms if the customer wants to
proceed with booking a room or exit if they choose 'no'.
3. **`roomBook()`**
- **Purpose**: This method helps the user select the type of
room they prefer and checks for availability.
- **Usage**: Displays room options (King Suite, Queen Suite,
AC Deluxe, Non-AC Deluxe) and invokes the corresponding
room description functions (`RoomDescript.King()`,
`RoomDescript.Queen()`, `RoomDescript.AC()`,
`RoomDescript.Non()`). It checks for room availability based on
bed preference (single or double), and assigns the room to the
customer.
4. **`randomPiller(boolean[] A)`**
- **Purpose**: Initializes the array of room availability status
(true or false) randomly for each type of room.
- **Usage**: The function sets a random availability (`true` or
`false`) for rooms in an array of boolean values for different
room types (King, Queen, AC, Non-AC).
5. **`registration()`**
- **Purpose**: Collects detailed customer information
required for booking and registration.
- **Usage**: It asks for the customer's name, gender,
residential address, occupation, purpose of visit, number of
rooms, number of adults, and children. Additionally, it collects
information about whether the customer wants complimentary
breakfast.
6. **`billCalc()`**
- **Purpose**: This method calculates the bill for the stay
based on room type, number of days, additional charges (like
for adults and children exceeding room capacity), and
complimentary breakfast.
- **Usage**: It calculates the room rate, additional charges,
and generates the final gross amount, tax, and net bill.
7. **`display(double n)`**
- **Purpose**: Displays the final bill details to the customer.
- **Usage**: It prints out a summary of the customer's
booking, including room type, room number, total number of
people, check-in date, total stay duration, gross amount, taxes,
and the net amount. It also asks for the mode of payment.
1. **`King()`**
- **Purpose**: Displays the description of the King Suite room
and prompts the user to choose this room type.
- **Usage**: Provides detailed information about the King
Suite, including features and costs. It returns `true` if the
customer chooses the King Suite.
2. **`Queen()`**
- **Purpose**: Displays the description of the Queen Suite
room and prompts the user to choose this room type.
- **Usage**: Provides detailed information about the Queen
Suite, including features and costs. It returns `true` if the
customer chooses the Queen Suite.
3. **`AC()`**
- **Purpose**: Displays the description of the A/C Deluxe
room and prompts the user to choose this room type.
- **Usage**: Provides detailed information about the A/C
Deluxe room, including features and costs. It returns `true` if
the customer chooses the A/C Deluxe room.
4. **`Non()`**
- **Purpose**: Displays the description of the Non-A/C Deluxe
room and prompts the user to choose this room type.
- **Usage**: Provides detailed information about the Non-A/C
Deluxe room, including features and costs. It returns `true` if
the customer chooses the Non-A/C Deluxe room.
LIMITATIONS:
1. **Limited Room Availability Simulation**
- The room availability is randomly determined using the
`randomPiller()` method. However, the program does not
properly check for room availability. The logic in the
`roomBook()` method uses a random approach, but there's no
persistent check to see if a room is truly available across
multiple bookings.
- The current implementation doesn't account for multiple
users trying to book rooms at the same time.
System.out.println(":,,;;;,,;,,,,,::,,,,,:,,:::,,,;;;,,:,,,,,::,,,,,;;;;;.....,,,,,:::,,
,,,;;;;;,,");
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::");
System.out.println(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;");
System.out.println("");
Hotel_Management ob= new Hotel_Management();
ob.input();
ob.roomBook();
ob.registration();
ob.billCalc();
}
public void input()
{
System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
System.out.println(" 5 Raffles Avenue, Singapore -
0399797");
System.out.println();
System.out.println("Dear customer,");
System.out.println(" A warm welcome to our online
booking site, for the greatest hotel in Singapore,");
System.out.println("built in the year 1987.");
System.out.println("At Hotel Red Star, we bring to you
absolutely modern living in utmost comfort, ");
System.out.println("amidst the fragnance of our glorious
heritage.");
System.out.println();
System.out.println("Be you a native weekend tourist, or be
you an international tourist coming ");
System.out.println("to witness the wonders of Singapore,
be assured that we will take up the ");
System.out.println("responsibility of making your stay a
memorable one.");
System.out.println();
System.out.println("Do you want to book a room in our
grand hotel?");
System.out.println("Please reply in yes or no: ");
if((sc.next()).equalsIgnoreCase("yes"))
{
System.out.println();
System.out.println("Please state your date of visit, and
the number of days you intend to stay");
System.out.println("Date: ");
date= sc.next();
System.out.print("Number of days: ");
days= sc.nextInt();
}
else
System.exit(0);
}
void registration()
{
String n1,n2;
System.out.println();
System.out.println("_");
System.out.println(" REGISTRATION ");
System.out.println(" '''''''''''''''''''''''''''");
System.out.println("_");
System.out.println(" ");
System.out.println("Name: ");
n1=sc.next(); n2=sc.nextLine(); name=n1+' '+n2;
System.out.print("Gender: ");
gen=sc.next();
System.out.println("Residential Address: ");
n1=sc.next(); n2=sc.nextLine();add=n1+' '+n2;
System.out.println("Occupation: ");
n1=sc.next(); n2=sc.nextLine();occp=n1+' '+n2;
System.out.print("Purpose of visit: ");
n1=sc.next(); n2=sc.nextLine();pur=n1+' '+n2;
System.out.println("Number of rooms booked: ");
no=sc.nextInt();
System.out.print("Total number of adults: ");
adults=sc.nextInt();
System.out.print("Total number of children(below 18): ");
child=sc.nextInt();
System.out.println("THANK YOU!!!");
System.out.println("Do you wish to have complementary
breakfast(yes/no)? ");
String bk=sc.next();
breakfast=bk.equalsIgnoreCase("yes");
}
void display(double n)
{
System.out.println();
System.out.println(" HOTEL RED STAR
");
System.out.println(" ^^^^^^^^^^^^^^^^
");
System.out.println();
System.out.println("Room type: "+rname);
System.out.println("Room number= "+room);
System.out.println("Customer Name: "+name);
System.out.println("Total number of people= "+
(adults+child));
System.out.println("Date of check-in: "+date);
System.out.println("Days stayed= "+days);
System.out.println();
System.out.println("Gross amount= "+n);
double servetax=(5.0/100)*n;
double vat=(14.5/100)*(servetax+n);
double bill=servetax+vat+n;
System.out.println("Taxes= "+vat);
System.out.println("Net amount= "+bill);
System.out.println();
System.out.println("Please enter mode of payment: ");
String mode=sc.next();
System.out.println("THANK YOU!!");
}
}
class RoomDescript
{
/**
* Will contain the descriptions of the rooms. When the user
inputs his choice, a description will be available,
* which will be accessible through this class.
*/
static Scanner sc=new Scanner(System.in);
static boolean King()
{
boolean a=false;
System.out.println("KING SUITE");
System.out.println("");
System.out.println("The King Suite is for the very best of
our guests. With the world class ");
System.out.println("features, and excellent room decor,
this suite is nothing short of ");
System.out.println("perfection, which i desired by many.
The room is spacy, and the ");
System.out.println("cosiness of it makes one feel at home,
albeit a more comfortable and ");
System.out.println("more exquisite one. We assure you,
that if this shall be your choice, you ");
System.out.println("shall regret the day of your
departure.");
System.out.println("");
System.out.println("Features");
System.out.println("^^^^^^^^^^^^");
System.out.println("");
System.out.println("> 350X200 ft.room,large,spacy and
comfortable");
System.out.println("> A gigantic Double-bed.with
Specktron-tehnology custom made ");
System.out.println(" mattress, for a good night's sleep");
System.out.println("> Air-conditioned, with two split A/Cs.
");
System.out.println("> A 42 inch LG Smart TV");
System.out.println("> Two large sofas, a bedside table,
and a coffee table");
System.out.println("> A long balcony, with a stunning view
of the Marina Bay Sands, as well as the ");
System.out.println(" rest of Singapore");
System.out.println("> A mini-bar, with an assortment of
the finest elixirs of Singapore");
System.out.println("> A huge bathroom, fit for a king.");
System.out.println("");
System.out.println("The cost for this room(exclusive of
taxes) is = Rs.8000/day");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("Do you want to choose this type?");
System.out.println("Enter 'yes' to book or 'no' to go back
to the menu: ");
if(sc.nextLine().equalsIgnoreCase("yes"))
a=true;
System.out.println("");
return a;
}
OUTPUT: