Hotel Computer Project JAVA ICSE
Hotel Computer Project JAVA ICSE
Index
Certificate 2
2 Acknowledgement 3
3 Theory 4
4 Coding 9
5 Output 17
6 Conclusion 18
1
Akansha Hotel Management
CERTIFICATE
2
Akansha Hotel Management
Acknowledgement
Akshita Raj
3
Akansha Hotel Management
Theory
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
4
Akansha Hotel Management
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
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
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
limited export possibilities, hotels are often one of the few sources of foreign
are provided by hotels industries in most courtiers, many others in the industry
5
Akansha Hotel Management
Hotels are an important source of amenities for local residents. Their restaurants,
The tourists are only product components; for the tourist what he buys is a
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
Hotels play an important role in most countries in providing facilities for the
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
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
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
Different hotel services generate different profit margins, and even a simple
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
therefore, quite easy for small hotels to produces informative accounts, and to do
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));
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
Meerut
********
2. BreakFast
3. Lunch Dinner
4. Bill
5. Detail
6. Quit
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
19