You are on page 1of 24

COMPUTER

APPLICATION
PROJECT

ICSE 2021 – 2022

HOTEL RESERVATION SYSTEM

BY: -_____________________
CLASS: X SECTION:____
(Roll No:______)

1
ACKNOWLEDGEMENT
This Project would not have been possible without the guidance and the help of
several individuals who in one way or another contributed and extended their
valuable assistance in the preparation and completion of this study.

First and foremost, I express utmost gratitude to our computer Teacher whose
inputs and encouragement has been my inspiration as I hurdle over the obstacles
in the completion of this project work.

I would specially like to thank our Lab-in charge/Teacher __________ for


providing enough lab sessions to ensure proper editing and execution of the
project program.

I thank all the members of the family who always had a kind concern and
consideration regarding all my project and academic requirements.

Last but not the least, I thank my classmates for all the cooperation and resources
they extended to me. I specially thank to our Principal Sir for his selfless interest
in my project.

Name – _______________

Class – X Section:_______

2
TABLE OF CONTENTS

1 Introduction 4

2 Program Statement 5

3 Program Listing 6-19

4 Sample Output 20-22

5 Variable Description 23-24

6 Conclusion 25

7 Bibliography 26

3
INTRODUCTION
This is to meet the Internal Assessment requirements of ICSE 2019-2020
Computer Applications paper. Apart from this, it is a great learning experience
too.

This project is a Java application which generates a menu for the user to choose
from available Room types from the Hotel.

I choose this topic because this gives a good acquaintance with the pattern and
the standard of programming questions in the board exam. Some aspects covered
in this project are:

 Menu Driven Program


 If-Else Statements
 Processing Strings and Arrays
 Class and Objects
 Concluding program with a glossary
 Defining and calling functions

Apart from just theoretical scripting of a program, this project actually coerces
us to edit, compile, debug and run our application. Many syntactical and
practical program issues are implicitly understood while accomplishing the
assignment.

4
PROGRAM STATEMENT

Create a Java application which generates a menu for the user to

choose from 4 hotels the following options:-

Choice 1: Super Deluxe Room

Choice 2: Deluxe Room

Choice 3: Ac Room

Choice 4: Non Ac Room

The program is supposed to book the room and show the bill
accrued. Once a room is booked it cannot be booked further, until
the guest performs a check-out.

5
PROGRAM LISTING
import java.util.*;

class HOTEL_RESERVATION_SYSTEM

public static void main(String args[]) throws IOException

Scanner sc=new Scanner(System.in);

System.out.println();

System.out.println("
====================00000000000000=================== ");

System.out.println(" :::: ROSE VALLEY INTERNATIONAL :::: ");

System.out.println(" 12/8/9 C AJC ROAD , KOLKATA , WEST BENGAL , INDIA


");

System.out.println("
====================00000000000000=================== ");

System.out.println();

System.out.println(" RVI is an experience that welcomes you to a new approach of


Hospitality ");

System.out.println(" Our elegancy and courteous service makes us the finest business hotel
group.");

System.out.println(" A 5-minute walk from a metro station, this upscale hotel is 2.3 km from
the ");

System.out.println(" Victoria Memorial & National Museum and 7 km from Science City of
Kolkata. ");

System.out.println();

System.out.println("
====================********************=================== ");
6
System.out.println(" Elegant rooms and suites feature wood floors, free Wi-Fi and flat-screen
TVs, ");

System.out.println(" in addition to sitting areas, stocked minibars, and Italian marble


bathrooms. ");

System.out.println(" Suites add separate living rooms with coffee tables. ");

System.out.println("
====================********************=================== ");

System.out.println();

System.out.println(" ==================== ................... ==================


");

System.out.println(" ! Mobile & Internet Booking is also available ! ");

System.out.println(" ***For Mobile Booking Call +919854245865 From Your Mobile***


");

System.out.println(" PREMIUM RATES APPLY ");

System.out.println(" ! For Internet Booking Visit :http://www.rvihotels.com ! ");

System.out.println(" ==================== ................... ===================


");

System.out.println();

System.out.println(" RULES & REGULATIONS :::::>>>>> ");

System.out.println(" </> Check-out time should be inform to the reception if you wish to
reatin. ");

System.out.println(" </> Please present your ID proof at the time of reservation. ");

System.out.println(" </> Bills must be settled either in Cash or Card , personal cheque will
not be accepted. ");

System.out.println(" </> Bills must be settled either in Cash or Card , personal cheque will
not be accepted. ");

System.out.println();

System.out.println(" Do you want to Book a Room in our Hotel ? \n 1. Yes 2. No ");

System.out.print(" Enter Your Choice : ");

7
int choice=sc.nextInt();

switch(choice)

case 1:

System.out.println();

System.out.println(" FILL UP THE REGISTRATION FORM GIVEN BELOW :");

System.out.println(" ^^^^^^^ ******************** ^^^^^^^^^ ");

System.out.print(" Full Name : ");

String name=sc.nextLine();

System.out.print(" Mobile Number : ");

longmb=sc.nextLong();

System.out.print(" Check-in Date : ");

String chkin=sc.nextLine();

System.out.print(" No. of Days you want to stay : ");

int days=sc.nextInt();

System.out.print(" No. of Children Boarders (Below 18 years of age) : ");

int child=sc.nextInt();

System.out.print(" No. of Adult Boarders (Above 18 years of age) : ");

int adults=sc.nextInt();

System.out.print(" No. of Rooms Required : ");

int rooms=sc.nextInt();

System.out.println(" THANK YOU!!!!");

System.out.println();

System.out.println(" Types Of Rooms Available : \n


==============================");

System.out.println(" <<==============================>> ");

8
System.out.println(" 1. Super Deluxe. (Rs.4500 per night)");

System.out.println(" The Facilities are :> ");

System.out.println(" * Double bed with a comfortable mattress.");

System.out.println(" * Air conditioning with Two Split AC.");

System.out.println(" * A large sofa, centre table, One bed table beside bed.");

System.out.println(" * Refrigerator , Microwaven .");

System.out.println(" * 50 inch Led TV.");

System.out.println(" ------------------------- ");

System.out.println(" ------------------------- ");

System.out.println(" 2. Deluxe Room. (Rs.3800 per night)");

System.out.println(" The Facilities are :> ");

System.out.println(" - Double bed with soft, comfortable mattress.");

System.out.println(" - Air Conditioning with One Split AC.");

System.out.println(" - A large sofa , One bed table beside bed.");

System.out.println(" - 42 inch Led TV.");

System.out.println(" ------------------------- ");

System.out.println(" ------------------------- ");

System.out.println(" 3. AC Room. (Rs.3000 per night)");

System.out.println(" Double bed with a super soft comfortable mattress.");

System.out.println(" > Air Conditioning with Two Split ACs.");

System.out.println(" > Electronic Safe.");

System.out.println(" > A large sofa set, centre table.");

System.out.println(" > 30 inch Led TV.");

System.out.println(" ------------------------- ");

System.out.println(" ------------------------- ");

System.out.println(" 4.Non-AC. (1900 per night)");


9
System.out.println(" The Facilities are :");

System.out.println(" > Choice of single or double bed with a soft mattress.");

System.out.println(" > A sofa set , One bed table beside bed.");

System.out.println(" > 24 inch Lcd TV.");

System.out.println();

System.out.print(" Please enter your choice: ..............." );

intrm=sc.nextInt();

switch(rm)

case 1:

System.out.println(" You have selected Super Deluxe.");

long amt=2800*days*adults*rooms+(2800*days*child*rooms)/2;

System.out.println();

System.out.println(" Generating The BILL");

System.out.println(" Please Wait ...................");

for(long j=0;j<559999999;j++);

System.out.println(" DONE");

System.out.println();

System.out.println(" :::: ROSE VALLEY INTERNATIONAL :::: ");

System.out.println(" 12/8/9 C AJC ROAD , KOLKATA , WEST BENGAL , INDIA


");

System.out.println(" \t\t\t************ BILL ************ ");

System.out.println();

System.out.println(" Name : "+name);

System.out.println(" Mobile Number : "+mb);

System.out.println(" Check-in Date : "+chkin);

10
System.out.println(" Room Package Booked : "+"Super Deluxe Room. ");

System.out.println(" No. of Days for stay : "+days);

System.out.println(" No. of Children Boarders to stay : "+child);

System.out.println(" No. of Adult Boarders to stay : "+adults);

System.out.println(" Total no. of Boarders to stay : "+(adults+child));

System.out.println(" No. of Rooms Booked : "+rooms);

System.out.println(" Gross Amount : "+amt);

double vat=Math.round(14.5/100.0*amt);

doublesrvtax=Math.round(9.0/100.0*amt);

System.out.println(" Total Taxes : Rs."+(vat+srvtax));

System.out.println(" Total Amount to be paid : Rs."+(amt+vat+srvtax));

System.out.println(" Enter the mode of payment : \n 1.CASH 2. CARD ");

System.out.print(" Enter your choice : ");

String pymnt=sc.nextLine();

System.out.println();

System.out.println(" Thanks for using our services!!! \n Visit Again!!");

System.out.println();

System.out.println("
======================XXXXX=========================");

break;

case 2:

System.out.println(" You have selected Deluxe Room.");

long amt=4200*days*adults*rooms+(4200*days*child*rooms)/2;

System.out.println();

System.out.println(" Generating The BILL");

System.out.println(" Please Wait ...................");

11
for(long j=0;j<559999999;j++);

System.out.println(" DONE");

System.out.println();

System.out.println(" :::: ROSE VALLEY INTERNATIONAL :::: ");

System.out.println(" 12/8/9 C AJC ROAD , KOLKATA , WEST BENGAL , INDIA


");

System.out.println(" \t\t\t************ BILL ************ ");

System.out.println();

System.out.println(" Name : "+name);

System.out.println(" Mobile Number : "+mb);

System.out.println(" Check-in Date : "+chkin);

System.out.println(" Room Package Booked : "+"Deluxe Room");

System.out.println(" No. of Days for stay : "+days);

System.out.println(" No. of Children Boarders to stay : "+child);

System.out.println(" No. of Adult Boarders to stay : "+adults);

System.out.println(" Total no. of Boarders to stay : "+(adults+child));

System.out.println(" No. of Rooms Booked : "+rooms);

System.out.println(" Gross Amount : "+amt);

double vat=Math.round(14.5/100.0*amt);

doublesrvtax=Math.round(9.0/100.0*amt);

System.out.println(" Total Taxes : Rs."+(vat+srvtax));

System.out.println(" Total Amount to be paid : Rs."+(amt+vat+srvtax));

System.out.println(" Enter the mode of payment : \n 1.CASH 2. CARD ");

System.out.print(" Enter your choice : ");

String pymnt=sc.nextLine();

System.out.println();

12
System.out.println(" Thanks for using our services!!! \n Visit Again!!");

System.out.println();

System.out.println("
======================XXXXX=========================");

case 3:

System.out.println(" You have selected AC Room.");

long amt=7700*days*adults*rooms+(7700*days*child*rooms)/2;

System.out.println();

System.out.println(" Generating The BILL");

System.out.println(" Please Wait ...................");

for(long j=0;j<559999999;j++);

System.out.println(" DONE");

System.out.println();

System.out.println(" :::: ROSE VALLEY INTERNATIONAL :::: ");

System.out.println(" 12/8/9 C AJC ROAD , KOLKATA , WEST BENGAL , INDIA


");

System.out.println(" \t\t\t************ BILL ************ ");

System.out.println();

System.out.println(" Name : "+name);

System.out.println(" Mobile Number : "+mb);

System.out.println(" Check-in Date : "+chkin);

System.out.println(" Room Package Booked : "+"Executive Suite");

System.out.println(" No. of Days for stay : "+days);

System.out.println(" No. of Children Boarders to stay : "+child);

System.out.println(" No. of Adult Boarders to stay : "+adults);

System.out.println(" Total no. of Boarders to stay : "+(adults+child));

System.out.println(" No. of Rooms Booked : "+rooms);


13
System.out.println(" Gross Amount : "+amt);

double vat=Math.round(14.5/100.0*amt);

doublesrvtax=Math.round(9.0/100.0*amt);

System.out.println(" Total Taxes : Rs."+(vat+srvtax));

System.out.println(" Total Amount to be paid : Rs."+(amt+vat+srvtax));

System.out.println(" Enter the mode of payment : \n 1.CASH 2. CARD ");

System.out.print(" Enter your choice : ");

String pymnt=sc.nextLine();

System.out.println();

System.out.println(" Thanks for using our services!!! \n Visit Again!!");

System.out.println();

System.out.println("
======================XXXXX=========================");

break;

case 4:

System.out.println(" You have selected Non-AC Room.");

long amt=2100*days*adults*rooms+(2100*days*child*rooms)/2;

System.out.println();

System.out.println(" Generating The BILL");

System.out.println(" Please Wait ...................");

for(long j=0;j<559999999;j++);

System.out.println(" DONE");

System.out.println();

System.out.println(" :::: ROSE VALLEY INTERNATIONAL :::: ");

System.out.println(" 12/8/9 C AJC ROAD , KOLKATA , WEST BENGAL , INDIA


");

System.out.println(" \t\t\t************ BILL ************ ");


14
System.out.println();

System.out.println(" Name : "+name);

System.out.println(" Mobile Number : "+mb);

System.out.println(" Check-in Date : "+chkin);

System.out.println(" Room Package Booked : "+"Non-AC Room");

System.out.println(" No. of Days for stay : "+days);

System.out.println(" No. of Children Boarders to stay : "+child);

System.out.println(" No. of Adult Boarders to stay : "+adults);

System.out.println(" Total no. of Boarders to stay : "+(adults+child));

System.out.println(" No. of Rooms Booked : "+rooms);

System.out.println(" Gross Amount : "+amt);

double vat=Math.round(14.5/100.0*amt);

doublesrvtax=Math.round(9.0/100.0*amt);

System.out.println(" Total Taxes : Rs."+(vat+srvtax));

System.out.println(" Total Amount to be paid : Rs."+(amt+vat+srvtax));

System.out.println(" Enter the mode of payment : \n 1.CASH 2. CARD ");

System.out.print(" Enter your choice : ");

String pymnt=sc.nextLine();

System.out.println();

System.out.println(" Thanks for using RVI reservation systems!!! ");

System.out.println();

System.out.println("
======================XXXXX=========================");

break;

else

15
{

System.out.println();

System.out.println(" You have given a Wrong Choice!!");

System.out.print(" For exit from the RVI reservation system please type the word 'Quit'!! : "
);

String ans=br.readLine();

if(ans.equals("quit")||ans.equals("QUIT")||ans.equals("Quit"))

System.out.println();

System.out.println(" Thanks For Visiting ROSE VALLEY INTERNATIONAL !! Hope You


Enjoy \n Please Come Again !!!");

System.out.println();

System.out.println(" ========================= @@@@@@@@@@@@@


======================");

System.exit(0);

else if(choice>1)

System.out.println(" THANK YOU. !!!!!!!!!! ");

System.out.println();

System.out.println(" ========================= @@@@@@@@@@@@@


==========================");

for(long j=0;j<859999999;j++);

System.exit(0);

16
}

SAMPLE OUTPUT :

If Choice is 1 output:

17
If 1 is pressed for booking, the following information is collected from the guest:

Then it goes on to show the type of rooms that are available:

18
In case ‘Super Deluxe’ room is selected, the rooms are booked after checking for availability and the bill is presented:

You can continue booking or check out. For check out:


19
20
Variable Description
Class Name: CustomerInfo

Variable Data type Description


vat double Value added tax

name String User’s name

mb Long Accept user’s phone number

chkin String Accept user’s check-in date

roomPackag String Type of room


e

days Integer Accept the user’s number of days of stay

child Integer Accept the number of children form user

adults Integer Accept the number of adults

rooms Integer Accept the number of rooms

amt double Bill amount

vat Double Value Added Tax

srvtax Double Service tax

roomNo Long Room No. allocated/booked

Class Name: Hotels

Variable Data type Description


p int Represents index of the customer array of objects ‘ci’.

startRoomNo long Room No. of the starting room

name String Name of the hotel

address String Address of the hotel


21
chkin String Accept user’s check-in date

roomPackage String Type of room

typeSuperDeluxe Integer Total number of Super Deluxe rooms.

typeDeluxeRoom Integer Total number of Deluxe rooms.

typeACRoom Integer Total number of AC rooms.

typeNonACRoo Integer Total number of Non AC rooms.


m

ci CustomerInfo Array of objects representing customer information.

pymnt String Type of payment Card/Cash

ans String For continue booking depending upon user’s choice.

rm int Type of room to book.

choice int Choice for booking or Check-Out

f int Flag variable to check for availability.

fl boolean Flag variable to check for presence of the room number


during check-out.

Class Name: HotelReservationSystem

Variabl Data type Description


e
ch int Accept user’s choice.

ob1 Hotels Object to store information of a hotel

ob2 Hotels Object to store information of a hotel

ob3 Hotels Object to store information of a hotel

ob4 Hotels Object to store information of a hotel

22
CONCLUSION
This project has been a great tutor as far as practical aspects of programming are concerned.

I planned the program with my classmates and then discussed it with my teachers. After

drafting the source code, I punched it in the computer followed by debugging and testing it,

both at home and school. Subsequently, I was able to get an error free code to put in my

project.

This has not only drilled me on the subject but also taught me things like team work, time

management, and research work and presentation skills. These are the lessons for my life,

which will always stay with and help me in my career.

23
BIBLIOGRAPHY
These are the followed books I have referred to for completing my project:-



24

You might also like