java management system for hotel
Hotil managimint systim projict fiaturis and function riquirimint. Shari java Projict idias and topics with us. grati and many java projict idias and topics. hiri somi java projict idias for risiarch papir. hiri largi colliction of java projict with sourci codi and databasi. wi many idia to divilopmint application liki mobili application,disktop softwari application,wib application divilopmint. you can find mori projict topics and idias on java. divilopmint idias on Hotil managimint systim. many projict availabli to download with java sourci codi and databasi. frii download Hotil managimint systim projict synopsis availabli.
//Written by Muhammad Ashfaq maher
import java.util.*;
public class hotelManagementSystem
{
public static void main(String
args[])
{
Scanner input = new
Scanner(System.in); // Taking integer
form user
Scanner Input = new
Scanner(System.in); // Taking string
form user
Scanner inpuT =new
Scanner(System.in); // Taking character
from user
int roomKey[] =
{001,031,213,322,433,531,116,711,811,91,102,121,12,413,14,115,136,127,148,119,230,211,223,323,224,225,236,272,282,291};
String Room[] = {"Room*** no 01
","Room*** no 02 ","Room*** no 03 ","Room*** no
04","Room*** no 05","Room*** no 06","Room*** no
07","Room*** no 08","Room*** no 09",
"Room*** no
10","Room** no 01","Room** no 02","Room** no
03","Room** no 04","Room** no 05","Room** no
06","Room** no 07","Room** no 08","Room** no
09",
"Room** no
10","Room* no 01","Room* no 02","Room* no
03","Room* no 04","Room* no 05","Room* no
06","Room* no 07","Room* no 08","Room* no
09","Room* no 10"};
String Food[] = {"chicken
karrai","Beaf karrai","Mutan karrai","chicken
biryani","Nan channay","halwa pori","Dal
chawal","kabli palauo","chines
Rice","Makruni","tikka karrai",};
int foodPrice[] =
{200,230,370,120,130,140,80,130,110,220,300};
String name[]=new String[30];
String gender[]=new String[30];
int[] id=new int[30];
int
totalIncome=0,totalDuesVehical=0,rent,i=0,j=10,k=20,l=0,pp=0,kk=-1,uo=0;
for(int s=0;s!=-1;s++) {
System.out.println("\n//////////
WELCOME TO
/////////////");
System.out.println("////////
Hotel Managment System ///////////");
System.out.println(" Menu \n ");
System.out.println("Enter 1
for transport service \n Enter 2 for reservation of RooM \n Enter 3 for clients
information \n Enter 4 for leaving custmer \n Enter 5 for Food services \n
Enter 6 to check total income ");
System.out.println("Enter 7
to check for salaries for hotel
staff");
char choice =
inpuT.next().charAt(0);
switch(choice) {
case '1':
System.out.println("Enter 1
for A.C car service \n Enter 2 for non A.C car Service \n Enter 3 for rishka
service ");
char
cHoice=inpuT.next().charAt(0);
switch(cHoice)
{
case '1':
System.out.println("Charges are 100/KM ");
System.out.println("Enter
the distance in kilo meter :");
int distance =
input.nextInt();
totalDuesVehical=(30*distance);
totalIncome+=(100*distance);
totalIncome-=totalDuesVehical;
break;
case '2':
System.out.println("Charges are 70/KM
");
System.out.println("Enter
the distance is Kilo meter :");
int Distance=input.nextInt();
totalDuesVehical=27*Distance;
totalIncome+=(70*Distance);
totalIncome-=totalDuesVehical;
break;
case '3':
System.out.println("Charges are 20/Km");
System.out.println("Enter
the distance in kilo meter :");
int distancE= input.nextInt();
totalDuesVehical=10*distancE;
totalIncome+=(20*distancE);
totalIncome-=totalDuesVehical;
break;
default:
System.out.println("Invaild
Entry ");
}
break;
case '2':
System.out.println("Enter A to
reserve room for classA custmers\n \n Enter B to reserve room for classB
custmers\n \n Enter C to reserve room for classC custmers ");
char ch=inpuT.next().charAt(0);
switch(ch)
{
case 'A':
if(l<10)
{
if(i<30)
{
for(int ip=0;ip<=kk;i++)
l=kk;
System.out.println("Enter the
name of custmer ");
name[l]=Input.nextLine();
uo++;
System.out.println("Enter
the gender ");
gender[l]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[l]=input.nextInt();
System.out.println("Enter
the rent for classA*** room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[l]+"
is reserved for "+name[l]+"
Your Room key number "+roomKey[l]); ++i; l++; }
else
{ System.out.println(" Rooms
are not available for you : "); }}
else System.out.println("No More
classA*** Rooms are available for you");
break;
case 'B':
if(j<20)
{
if(i<30)
{
System.out.println("Enter the
name of custmer ");
name[j]=Input.nextLine();
System.out.println("Enter
the gender ");
gender[j]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[j]=input.nextInt();
System.out.println("Enter
the rent for classB** room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[j]+"
is reserved for "+name[j]+" Your Room key number "+roomKey[j]); ++i; j++;}
else
{ System.out.println(" Rooms
are not available in this time "); }}
else System.out.println("No more classB** Rooms are available ");
break;
case 'C':
if(k<30)
{
if(i<30)
{
System.out.println("Enter the
name of custmer ");
name[k]=Input.nextLine();
System.out.println("Enter
the gender ");
gender[k]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[k]=input.nextInt();
System.out.println("Enter
the rent for classC* room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[k]+"
is reserved for "+name[k]+" Your Your Room key number :"+roomKey[k]); ++i; ++k; }
else
{ System.out.println(" Rooms
are not available in this time "); }}
else System.out.println("No more classC* Rooms are available :");
break;
default:
System.out.println("Invaild
Entrey");
} break;
case '3':
System.out.println("Enter 1 to take information about classA
Room*** service\n Enter 2 to take information about classB Room** service \n
Enter 3 to take information about classB Room* service ");
char ChOice =
inpuT.next().charAt(0);
switch(ChOice)
{ case '1':
int w=0;
if((l==0)&&(pp==0))
{ System.out.println(" No
A class custmer are available :");}
else if((pp>w)||(l>w))
{ for(;(w<pp)||(w<l);w++)
{
System.out.println(name[w]+" gender "+gender[w]+" and ID
is"+id[w]);
}}
break;
case '2':
int e=10;
if(j==10)
{
System.out.println("
No B class custmer are available :");}
else if(j>e) {
for(;e<j;e++)
{
System.out.println(name[e]+" gender "+gender[e]+" and ID
is"+id[e]);
}}
break;
case '3':
int r=20;
if(k==20)
{ System.out.println(" No C
class custmer are available :");}
else if(k>r)
{
for(;r<k;r++)
{
System.out.println(name[r]+"\n gender "+gender[r]+" /nID
is"+id[r]);
}}
break;
default :
System.out.println("Invaild
Entery ");
}
break;
case '4':
System.out.println("Enter 1
when class A custmer are leaving \n Enter 2 when class B custmer are leaving \n
Enter 3 when class C custmer are leavig ");
char choicE =
inpuT.next().charAt(0);
switch(choicE)
{
case '1':
System.out.println("Enter the
room number who leave :0 to 9");
int n=input.nextInt();
pp=l;
kk=n;
if(n<l) {
System.out.println(name[n]+"\n gender "+gender[n]+" \nID
is"+id[n]+"\nAre leave from Hotel ");
name[n]=name[11];
gender[n]=gender[11];
id[n]=id[11];
}
else System.out.println("This Room*** is already empty ");
break;
case '2':
System.out.println("Enter the
room number who leave :10 to 19");
int y= input.nextInt();
if(y<j) {
System.out.println(name[y]+"\n gender "+gender[y]+" \nID
is"+id[y]+"\nAre leave from Hotel ");
j=++y;
j--; }
else System.out.println("This Room** is already empty ");
break;
case '3':
System.out.println("Enter the
room number who leave :20 to 29");
int u= input.nextInt();
if(u<k) {
System.out.println(name[u]+"\n gender "+gender[u]+" \nID
is"+id[u]+"\nAre leave from Hotel ");
k=++u;
k--; }
else System.out.println("This Room* is already empty ");
break;
default:
System.out.println("You Enter
a wrong number ");
}
break;
case '5':
System.out.println("\n//////////////Menu/////////////////////
\n");
System.out.println("//////////////These
Foods are available//////////\n");
for(int q=0;q<11;q++)
{
System.out.println(Food[q]+"\t\t"+foodPrice[q]);
}
System.out.println("please Enter the number do you want to eat
:");
int num = input.nextInt();
System.out.println("Thank you for bought "+Food[num-1]);
totalIncome+=foodPrice[num-1];
break;
case '6':
System.out.println("The
total income is :"+(totalIncome));
break;
case '7':
System.out.println();
break;
default:
System.out.println("Damag
theek hay nazar nahi aa raha :");
}}
}}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import java.util.*;
public class hotelManagementSystem
{
public static void main(String
args[])
{
Scanner input = new
Scanner(System.in); // Taking integer
form user
Scanner Input = new
Scanner(System.in); // Taking string
form user
Scanner inpuT =new
Scanner(System.in); // Taking character
from use
String
hotelStaff[]={"Omais","Imran","Moodi","Bush","Obama","Trump","Zardari","Shakh
","Nawaz
","Shahbaz","Imran","Jakey","iftikhar"};
String
Ranks[]={"Manager","Manager","Waiter","Waiter","Waiter","Waiter","Saweper","Saweper","Cock","Cock","Gardner","Security","Security"};
int
salaryStaff[]={40000,40000,13000,12000,13000,12000,10000,10000,14000,14000,9000,17000,14000};
int roomKey[] =
{901,031,213,322,433,531,116,711,811,91,102,121,12,413,14,115,136,127,148,119,230,211,223,323,224,225,236,272,282,291};
String Room[] = {"Room*** no 01
","Room*** no 02 ","Room*** no 03 ","Room*** no
04","Room*** no 05","Room*** no 06","Room*** no
07","Room*** no 08","Room*** no 09",
"Room*** no
10","Room** no 01","Room** no 02","Room** no
03","Room** no 04","Room** no 05","Room** no
06","Room** no 07","Room** no 08","Room** no
09",
"Room** no
10","Room* no 01","Room* no 02","Room* no
03","Room* no 04","Room* no 05","Room* no
06","Room* no 07","Room* no 08","Room* no
09","Room* no 10"};
String Food[] = {"chicken
karrai","Beaf karrai","Mutan karrai","chicken
biryani","Nan channay","halwa pori","Dal
chawal","kabli palauo","chines
Rice","Makruni","tikka karrai",};
int foodPrice[] =
{200,230,370,120,130,140,80,130,110,220,300};
String name[]=new String[30];
String gender[]=new String[30];
int[] id=new int[30];
int
totalIncome=0,rent,i=0,j=10,k=20,l=0,pp=0,kk=-1,uo=0,day=1; //These are variable that control the flow
of program
for(int s=0;s!=-1;s++) {
System.out.println("\n//////////
WELCOME TO
/////////////");
System.out.println("////////
Hotel Managment System ///////////");
System.out.println(" Menu \n ");
System.out.println(" Enter 1
for transport service \n Enter 2 for reservation of RooM \n Enter 3 for clients
information \n Enter 4 for leaving custmer \n Enter 5 for Food services \n
Enter 6 to check total income ");
System.out.println("Enter 7
to check for salaries for hotel staff\n
Enter 8 for dues of hotel :");
char choice =
inpuT.next().charAt(0);
switch(choice) {
case '1':
System.out.println("Enter 1
for A.C car service \n Enter 2 for non A.C car Service \n Enter 3 for rishka
service ");
char
cHoice=inpuT.next().charAt(0);
switch(cHoice)
{
case '1':
System.out.println("Charges are 100Rs/KM ");
System.out.println("Enter
the distance in kilo meter :");
int distance =
input.nextInt();
int debit=(30*distance);
totalIncome+=(100*distance);
totalIncome-=debit;
System.out.println("Your
rent is = "+(100*distance));
System.out.println("The
debit on this service is ="+debit);
break;
case '2':
System.out.println("Charges are 70Rs/KM ");
System.out.println("Enter
the distance is Kilo meter :");
int Distance=input.nextInt();
int debiT=27*Distance;
totalIncome+=(70*Distance);
totalIncome-=debiT;
System.out.println("Your
rent is = "+(70*Distance));
System.out.println("The debit
on this service is ="+debiT);
break;
case '3':
System.out.println("Charges are 20Rs/Km");
System.out.println("Enter
the distance in kilo meter :");
int distancE= input.nextInt();
int Debit=10*distancE;
totalIncome+=(20*distancE);
totalIncome-=Debit;
System.out.println("Your rent
is = "+(20*distancE));
System.out.println("The
debit on this service is ="+Debit);
break;
default:
System.out.println("Invaild
Entry ");
}
break;
case '2':
System.out.println("Enter A to
reserve room for classA custmers\n \n Enter B to reserve room for classB
custmers\n \n Enter C to reserve room for classC custmers ");
char ch=inpuT.next().charAt(0);
switch(ch)
{
case 'A':
if(l<10)
{
if(i<30)
{
for(int ip=0;ip<=kk;i++)
l=kk;
System.out.println("Enter the
name of custmer ");
name[l]=Input.nextLine();
uo++;
System.out.println("Enter
the gender ");
gender[l]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[l]=input.nextInt();
System.out.println("Enter the rent for
classA*** room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[l]+"
is reserved for "+name[l]+"
Your Room key number "+roomKey[l]);
System.out.println("Please
give Rent "+rent+"Rs then you Enter in this room"); ++i; l++;
}
else
{ System.out.println(" Rooms
are not available for you : "); }}
else System.out.println("No
More classA*** Rooms are available for you");
break;
case 'B':
if(j<20)
{
if(i<30)
{
System.out.println("Enter the
name of custmer ");
name[j]=Input.nextLine();
System.out.println("Enter
the gender ");
gender[j]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[j]=input.nextInt();
System.out.println("Enter
the rent for classB** room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[j]+"
is reserved for "+name[j]+" Your Room key number "+roomKey[j]);
System.out.println("Please
give Rent "+rent+"Rs then you Enter in this room"); ++i; j++;}
else
{ System.out.println(" Rooms
are not available in this time "); }}
else System.out.println("No more classB** Rooms are available ");
break;
case 'C':
if(k<30)
{
if(i<30)
{
System.out.println("Enter the
name of custmer ");
name[k]=Input.nextLine();
System.out.println("Enter
the gender ");
gender[k]=Input.nextLine();
System.out.println("Enter
the ID of custmer ");
id[k]=input.nextInt();
System.out.println("Enter
the rent for classC* room ");
rent=input.nextInt();
totalIncome+=rent;
System.out.println(Room[k]+"
is reserved for "+name[k]+" Your Your Room key number :"+roomKey[k]);
System.out.println("Please
give Rent "+rent+"Rs then you Enter in this room"); ++i; ++k; }
else
{ System.out.println(" Rooms
are not available in this time "); }}
else System.out.println("No more classC* Rooms are available :");
break;
default:
System.out.println("Invaild
Entrey");
} break;
case '3':
System.out.println("Enter 1 to take information about classA
Room*** service\n Enter 2 to take information about classB Room** service \n
Enter 3 to take information about classB Room* service ");
char ChOice =
inpuT.next().charAt(0);
switch(ChOice)
{ case '1':
int w=0;
if((l==0)&&(pp==0))
{ System.out.println(" No
A class custmer are available :");}
else if((pp>w)||(l>w))
{ for(;(w<pp)||(w<l);w++)
{
System.out.println(name[w]+" gender "+gender[w]+" and ID
is"+id[w]);
}}
break;
case '2':
int e=10;
if(j==10)
{
System.out.println("
No B class custmer are available :");}
else if(j>e) {
for(;e<j;e++)
{
System.out.println(name[e]+" gender "+gender[e]+" and ID
is"+id[e]);
}}
break;
case '3':
int r=20;
if(k==20)
{ System.out.println(" No C
class custmer are available :");}
else if(k>r)
{
for(;r<k;r++)
{
System.out.println(name[r]+"\n gender "+gender[r]+" /nID
is"+id[r]);
}}
break;
default :
System.out.println("Invaild
Entery ");
}
break;
case '4':
System.out.println("Enter 1
when class A custmer are leaving \n Enter 2 when class B custmer are leaving \n
Enter 3 when class C custmer are leavig ");
char choicE =
inpuT.next().charAt(0);
switch(choicE)
{
case '1':
System.out.println("Enter the
room number who leave :0 to 9");
int n=input.nextInt();
if(n<l) {
System.out.println("Name"+name[n]+"\n gender
"+gender[n]+" \nID is"+id[n]+"\nAre leave from Hotel
");
l=++n;
l--;
}
else System.out.println("This Room*** is already empty ");
break;
case '2':
System.out.println("Enter the
room number who leave :10 to 19");
int y= input.nextInt();
if(y<j) {
System.out.println(name[y]+"\n gender "+gender[y]+" \nID
is"+id[y]+"\nAre leave from Hotel ");
j=++y;
j--; }
else System.out.println("This Room** is already empty ");
break;
case '3':
System.out.println("Enter the
room number who leave :20 to 29");
int u= input.nextInt();
if(u<k) {
System.out.println(name[u]+"\n gender
"+gender[u]+" \nID is"+id[u]+"\nAre leave from Hotel
");
k=++u;
k--; }
else System.out.println("This Room* is already empty ");
break;
default:
System.out.println("You Enter
a wrong number ");
}
break;
case '5':
System.out.println("\n//////////////Menu/////////////////////
\n");
System.out.println("//////////////These
Foods are available//////////\n");
for(int q=0;q<11;q++)
{
System.out.println(Food[q]+"\t\t"+foodPrice[q]);
}
System.out.println("please Enter the number do you want to eat
:");
int num = input.nextInt();
System.out.println("Thank you for bought "+Food[num-1]);
totalIncome+=foodPrice[num-1];
break;
case '6':
System.out.println("The total income
is :"+(totalIncome));
break;
case '7':
System.out.println("////////////Welcome To/////////////");
System.out.println("//////////////Salary Menu//////////");
System.out.println("Enter 1 to check
the salary of all the staff\nEnter 2
When hotel staff recieve salary:");
char
CHOicE=inpuT.next().charAt(0);
switch(CHOicE)
{
case '1':
System.out.println("Names\t\tRanks\t\tSalary");
for(int as=0;as<13;as++)
{
System.out.println(hotelStaff[as]+"\t\t"+Ranks[as]+"\t\t"+salaryStaff[as]);}
break;
case '2':
System.out.println("If
you want to give salaries Enter 1 or when mounth is complete");
int number=input.nextInt();
if(number==1)
{
System.out.println("Names\t\tRanks\t\tSalary");
for(int
tu=0;tu<13;tu++)
{
System.out.println(hotelStaff[tu]+"\t\t"+Ranks[tu]+"\t\t"+salaryStaff[tu]+"\t
Reiceve salary");
totalIncome-=salaryStaff[tu];
}}
else
System.out.println("Salary is not found for you because mounth does
not complete :");
break;
default:
System.out.println("Wrong Entery");
}
break;
case '8':
System.out.println("Enter 1 for electric bill\nEnter 2 for gass
bill \nEnter 3 for water bill");
char
bill=inpuT.next().charAt(0);
switch(bill) {
case '1':
System.out.println("Enter the bill of this mounth:");
int
Bill=input.nextInt();
totalIncome-=Bill;
System.out.println(Bill+"is
cut from your total income \n Now your total income is ="+totalIncome);
break;
case '2':
System.out.println("Enter the bill of this mounth:");
int
BIll=input.nextInt();
totalIncome-=BIll;
System.out.println(BIll+"is cut from your total income \n Now your
total income is ="+totalIncome);
break;
case '3':
System.out.println("Enter the bill of this mounth:");
int BilL=input.nextInt();
totalIncome-=BilL;
System.out.println(BilL+"is cut from your total income \n Now your
total income is ="+totalIncome);
break;
default:
System.out.println("Enter right number please :");
} break;
default:
System.out.println("Damag
theek hay nazar nahi aa raha :");
}}
}}