0% found this document useful (0 votes)
1K views19 pages

Hotel Computer Project JAVA ICSE

This document contains coding for a hotel management system in Java. It includes classes for hotels, methods to add records for guests, calculate bills, and output totals. Data is input from the user and output to text files. Calculations are done to determine costs for rooms, food, and other services based on rates and quantities.

Uploaded by

Aditya Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
1K views19 pages

Hotel Computer Project JAVA ICSE

This document contains coding for a hotel management system in Java. It includes classes for hotels, methods to add records for guests, calculate bills, and output totals. Data is input from the user and output to text files. Calculations are done to determine costs for rooms, food, and other services based on rates and quantities.

Uploaded by

Aditya Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 19

Akansha Hotel Management

Index

S.No. Contents Page No.

Certificate 2

2 Acknowledgement 3

3 Theory 4

4 Coding 9

5 Output 17

6 Conclusion 18

1
Akansha Hotel Management

CERTIFICATE

This is to certify that this Computer Project which is submitted by

“Miss Akshita Raj " X t h in lieu partial fulfillment of the requirement

of Indian Certificate of Secondary Education (ICSE BOARD) by

I.S.C Examination Affiliated to New Delhi is record of his work

carried out by him.

Principal In Charge of Computer Department

Mr. Nikhil Chauhan

2
Akansha Hotel Management

Acknowledgement

Lastly I conclude that the program given for this project is an


overall summary of Java with in one program. Though it took sometime
to complete this project, but I really enjoyed preparing this project. I
could complete the theory portion easily but the coding part of the
project was a bit difficult. However, I overcame this difficulty with the
support of my computer teacher. I consulted my computer book for
preparing this project.

It is a noble chance to express my gratitude to all those who helped


me in completing this computer project.
It is a great pleasure for me to express my deep sense of respect
and gratitude to Sr. Principal, St. Mary's School, Najibabad. I'm also
thankful to Mr. Nikhil Chauhan for his regular and kind support during
this project. I’m very thankful to my family members for providing me
their precious suggestions.
I'm very thankful to Mr. Nikhil Chauhan for supporting and
encouraging me to make this computer Project.

Akshita Raj

3
Akansha Hotel Management
Theory

Java is a purely Object Oriented programming language and platform


independent. Java is a trademark or registered trademark of Sun
Microsystems, Inc. in the US and other countries.

Package java.io Description

Provides for system input and output through data streams, serialization and the
file system.

DataInputStream
A data input stream lets an application read primitive Java data types from an
underlying input stream in a machine-independent way.

DataOutputStream
A data input stream lets an application write primitive Java data types to an
output stream in a portable way

FileInputStream
A FileInputStream obtains input bytes from a file in a file system

FileOutputStream
A file output stream is an output stream for writing data to a File or to a
FileDescriptor.

BufferedReader
Read text from a character-input stream, buffering characters so as to provide for

the efficient reading of characters, arrays, and lines.

4
Akansha Hotel Management

Hotel investment requirement are basically of there types. Short-term capital is

required for up to a year for operating and minor capital expenditure; medium

term finance is required for several years for internal fixed assets; long term

finance, for more than a few year is required for land and buildings. The

distinction between long and short-term liabilities emphasizes their different

nature and the time scale of the obligations. The former is a form of total

financing of the hotel; the latter are in the main amounts owed to supplier and,

unless they include short term borrowing as bank overdrafts, they tend to be

relatively small in hotels.

Buying and Paying of Hotel Services

The buying decision is basically of two kinds. Deliberate or impulsive. Before

journeys, business people may ask secretaries to reserve hotels rooms in the

towns they are two visit for specified nights. A family may choice of holiday hotel

after a scrutiny of hotel guides. A society may make several inquires before

choosing the venue for their annual dinner dance. These are deliberate buying

decisions made with some advance planning and with advance reservations. A

tourist looking for somewhere to stay when traveling by car, or on arrival at the

railway station or airport, is likely to make an impulsive decision. in countries with

limited export possibilities, hotels are often one of the few sources of foreign

currency earnings. Hotels are important employers of labour. Thousands of jobs

are provided by hotels industries in most courtiers, many others in the industry

5
Akansha Hotel Management

are self-employed and proprietors of smaller hotels. The role of hotels as

employers is particularly important in areas with few alternative sources of

employment, where they contribute to regional development.

Hotels are an important source of amenities for local residents. Their restaurants,

bars and other facilities often attract much local customs.

Hotels in the Total Tourist product

The tourists are only product components; for the tourist what he buys is a

composite product, an amalgam of attractions, transportation, accommodation,

entertainment and other activities. The amalgam or package the tourist buys is

seen most clearly in the case of inclusive tours where the tour operate or another

organizer brings together all the elements of a holiday, which he promotes and

offers for sale as a single product at one inclusive price. All tourists buy

packages, whether they use travel agents or not, and whether they buy the

various components separately or as an inclusive tour, and this applies to holiday

as well as to business trips.Importance of Hotels.

Hotels play an important role in most countries in providing facilities for the

transaction of business, for meetings and conferences, for recreation and

entertainment. In that sense hotels are as essential to economics and societies

as are adequate transport, communication and retail distribution systems for

various goods and services. Through their facilities hotels contribute to the total

output of goods and service, which makes up the material well being of nation

and communities. In areas receiving foreign visitors, hotels are often important

6
Akansha Hotel Management
foreign currency earners and in this way may contribute significantly to their

countries balance of payment. Particular

Accounting and Control

Three main basic accounting records satisfy most requirements of most small

hotels.

A receipts and payments book records all cash transactions. In the course of

business sales accounts and invoices are filled separately and only recorded in

the book after payment has been received or made. At the end of the period

unrecorded transactions such as outstanding sales accounts, unpaid invoices,

prepayments and accruals are takes into account in preparing final accounts.

A visitor’s tabular ledger with individual accounts for all resident guest may

be extended to include separate accounts for functions, as well as for total cash

and credit sales in the restaurant and bar to customers using these facilities

without taking up sleeping accommodation. In this way the tabular ledger

represents an analyzed daily summary of all business done.

A wages book, which includes all employee and related payments,

provides a comprehensive record of all payroll transactions.

Different hotel services generate different profit margins, and even a simple

break done of revenue and expenditure can provide a helpful analysis of

performance to indicate the relative profitability of the different parts;

to establish a basis for monitoring and comparison

7
Akansha Hotel Management
to enable an assessment to be made of the effect of any changes introduced in

operation. If the basic records are kept in an analyzed form, the input data for a

meaningful analysis of results are available without much additional effort. It is

therefore, quite easy for small hotels to produces informative accounts, and to do

so more than once a year, from the basis record.

8
Akansha Hotel Management

Coding

import java.io.*;
import java.util.*;

class Hotel
{
String name,address;
char sex;
int age,ph_no;
DataInputStream in;
FileInputStream fis;
FileOutputStream out;
BufferedReader br;
PrintStream bw;
Date dd;
int bn,bb,fn,ff,rr,rn,qt1,qt2,qt3;
int total;
Hotel()
{
in=new DataInputStream(System.in);
name="";
total=0;
address="";
sex='m';
age=ph_no=0;
9
Akansha Hotel Management
dd=new Date();
}

void addreco()
{
try
{
out=new FileOutputStream("hotel.txt");
bw=new PrintStream(out);
System.out.println("\t\tEnter ur name\t");
name=in.readLine();
bw.println(name);
System.out.println("\t\tEnter ur address\t");
address=in.readLine();
System.out.println("\t\tEnter ur age\t");
age=Integer.parseInt(in.readLine());
System.out.println("\t\tEnter ur contact no.\t");
ph_no=Integer.parseInt(in.readLine());
System.out.println("\t\tEnter ur sex(m for male or f for female)\t");
sex=(char)in.read();
System.out.print("hjfhf");
bw.println(address);
bw.println(age);
bw.println(sex);
bw.println(ph_no);
bw.println(dd.getDate()+"/"+dd.getMonth()+"/06");bw.close();
}catch(Exception ee){System.out.print(ee.getMessage());}
}
void list()
{
try{
String str;
fis=new FileInputStream("hotel.txt");

10
Akansha Hotel Management
br=new BufferedReader(new InputStreamReader(fis));

System.out.println("******************************************
");System.out.println("\n\n lists of the Customers.........................");
System.out.println("\n\nName \t\t Address\t\t Age\t Sex\t Phone no.\t Date");
while((str=br.readLine())!=null)
{
System.out.println("\n"+str+"\t"+br.readLine()+"\t"+br.readLine()+"\t"+br.readLine()
+"\t"+br.readLine()+"\t"+br.readLine());
}
br.close();
}catch(Exception ee){}
}
void breakfast() throws Exception
{
System.out.println("****************************************** ");
System.out.println("\n\n\tSno. \t Food Name Price(Rs)");
System.out.println("\n\t1. \t Cold Drink 15 Rs");
System.out.println("\n\t2. \t Coffee 15 Rs");
System.out.println("\n\t3. \t Dosa 45 Rs");
System.out.println("\n\t4. \t Pizza 200 Rs");
System.out.println("\n\t5. \t Chaumine 15 Rs");
System.out.println("\n\t6. \t Alloo Chat 15 Rs\n");
System.out.print("Enter the Sno for the items (1-6)\t ");
bb=Integer.parseInt(in.readLine());
System.out.print("\nEnter the Quantity\t ");
bn=Integer.parseInt(in.readLine());
switch(bb)
{
case 1:
qt1+=bn*15;
break;
case 2:

11
Akansha Hotel Management
qt1+=bn*15;
break;
case 3:
qt1+=bn*45;
break;
case 4:
qt1+=bn*200;
break;
case 5:
qt1+=bn*15;
break;
case 6:
qt1+=bn*15;
break;
default :
System.out.println(" U have enter the wrong choice ......");
}
}
void lunch() throws Exception
{
System.out.println("****************************************** ");
System.out.println("\n\n\tSno. Food Name Price(Rs)");
System.out.println("\n\t1. Shahi Paneer 45 Rs");
System.out.println("\n\t2. Kharhi Paneer 50 Rs");
System.out.println("\n\t3. Dal Makhine 45 Rs");
System.out.println("\n\t4. Rice 15 Rs");
System.out.println("\n\t5. Roti 5 Rs");
System.out.println("\n\t6. Mashroom 55 Rs");
System.out.print("\n\nEnter the Sno for the food (1-6)\t ");
ff=Integer.parseInt(in.readLine());
System.out.print("\n\nEnter the Quantity\t ");
fn=Integer.parseInt(in.readLine());
switch(ff)

12
Akansha Hotel Management
{
case 1:
qt2+=fn*45;
break;
case 2:
qt2+=fn*50;
break;
case 3:
qt2+=fn*45;
break;
case 4:
qt2+=fn*15;
break;
case 5:
qt2+=fn*5;
break;
case 6:
qt2+=fn*55;
break;
default :
System.out.println("\n\n U have enter the wrong choice ......");
}

}
void room() throws Exception
{
System.out.println("****************************************** ");
System.out.println("\n\tSno. Room Type Price(Rs)");
System.out.println("\n\n\t1. Double Room(Ac) 250 Rs");
System.out.println("\n\t2. Double Room 200 Rs");
System.out.println("\n\t3. Single Room(Ac) 150 Rs");
System.out.println("\n\t4. Single Room 100 Rs");
System.out.print("\n\n\nenter the sno of the room ");

13
Akansha Hotel Management
rr=Integer.parseInt(in.readLine());
System.out.print("\n\nEnter the Quantity\t ");
rn=Integer.parseInt(in.readLine());
switch(rr)
{
case 1:
qt3+=rn*250;
break;
case 2:
qt3+=rn*200;
break;
case 3:
qt3+=rn*150;
break;
case 4:
qt3+=rn*100;
break;
default :
System.out.println("\n\n U have enter the wrong choice ......");
}

}
void bill() throws Exception
{
System.out.println("****************************************** ");
System.out.println("\n\n\n\tThanks for Ur Visit......");
System.out.println("\n\n\t Bill for the things.......");
System.out.println("\n\t 1. Charges for Room ........... "+qt1+" Rs");
System.out.println("\n\t 2. Charges for Breakfast ........... "+qt2+" Rs");
System.out.println("\n\t 3. Charges for Lunch/Dinner ..... "+qt3+" Rs");
System.out.println("\n\t 4. Charges for Tax ........... "+75+" Rs");
total=qt1+qt2+qt3+75;
System.out.println("\n\n\t Total Charges .......... "+total +" Rs");

14
Akansha Hotel Management
}
void main1()
{
BufferedReader inn;
Hotel obj=new Hotel();
char c;
System.out.println("\n\n\tLists Of The Services ..................");
System.out.println("\n\n\t1. \t Room For Booking ");
System.out.println("\n\t2. \t BreakFast");
System.out.println("\n\t3. \t Lunch Dinner");
System.out.println("\n\t4. \t Bill");
System.out.println("\n\t5. \t Detail");
System.out.println("\n\t6. \t Quit\n");
inn=new BufferedReader(new InputStreamReader(System.in));

System.out.print("\n\n \t Enter UR Choice (1 to 6)......\t");


int choice=0 ;
String str="";
try{
str=inn.readLine();
System.out.print(str);
choice=Integer.parseInt(inn.readLine());
}catch(Exception ee){System.out.print(ee.getMessage());choice=0;}
try{
switch(choice)
{
case 1:
obj.room();
obj.addreco();
break;
case 2:
obj.breakfast();
break;

15
Akansha Hotel Management
case 3:
obj.lunch();
break;
case 4:
obj.bill();
break;
case 5:
obj.list();
break;
case 6:
System.exit(0);
break;
default :
System.out.println("\n\n U have enter the wrong choice ......");
}
System.out.println("\n\t Do you want to order for other service press 'y'");
c=(char)in.read();
if(c=='y'||c=='Y')
{
main1();
}
else
{
obj.bill();
}
}catch(Exception ee){}
}
public static void main(String arg[]) throws Exception
{
System.out.println("\t Welcome To The RITZ Hotel ");
System.out.println(" ******************************************** ");
System.out.println("\n\t Meerut ");
System.out.println("\t ******** ");

16
Akansha Hotel Management
Hotel obj=new Hotel();
obj.main1();
}
}

17
Akansha Hotel Management
Output

Welcome To The RITZ Hotel


********************************************

Meerut
********

Lists Of The Services ..................

1. Room For Booking

2. BreakFast

3. Lunch Dinner

4. Bill

5. Detail

6. Quit

Enter UR Choice (1 to 6)......

18
Akansha Hotel Management

CONCLUSION

Lastly, I conclude that the program given for this project is an overall

summary of java with in one program. Though it took sometime to complete this

project, but I really enjoyed myself while preparing this project. I could complete

the theory portion easily but the coding part of the project was a bit difficult

without the support of computer sir.

19

You might also like