Hotel Management project in Java

By | September 23, 2018

Hotel Management Project in Java

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

I am sharing the source code of this simple project so copy and paste this code into your IDE just check the result of this simple project.

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

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package hotel.project;
import java.util.Scanner;

/**
*
* @author Hazrat Umer Okz
*/
public class HotelProject {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here

System.out.println(“\t\t\t\t\t**********************************************************”);
System.out.println(“\t\t\t\t\t\t\tWelcome to Sarhad Hotel”);
System.out.println(“\t\t\t\t\t**********************************************************”);

System.out.println(“\n\n”);
System.out.println(“Following are the menu which are availabe in our Hotel”);

System.out.println(“\n\n”);
System.out.println(“1.Chapli Kabab”);
System.out.println(“2.simple Chawal”);
System.out.println(“3.Chawal with chicken”);
System.out.println(“4.Half Roasted Chicken”);
System.out.println(“5.Full Roasted Chicken”);
System.out.println(“6.Chicken piece”);
System.out.println(“7.Vegetables with Salad”);
System.out.println(“8.Pulses”);
System.out.println(“9.Seekh Kabab”);
System.out.println(“10.Simple Beryani”);
System.out.println(“11.Simple Beryani with Riata”);
System.out.println(“12.Chicken Beryani”);

System.out.println(“\n\n”);

Scanner input = new Scanner (System.in);
int option;

System.out.println(“Please choose your option from above menu”);
option = input.nextInt();

switch(option)
{
case 1:
{
Scanner input1 = new Scanner (System.in);
int rs1;
int kababPrice=100;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+kababPrice+”for it “);
rs1 = input1.nextInt();

if(rs1<kababPrice)
{

System.out.println(“You entered “+rs1);
kababPrice=kababPrice-rs1;
System.out.println(“Please enter Rs.”+kababPrice);

}
else if(rs1>kababPrice)
{
rs1 = rs1-kababPrice;

System.out.println(“Please take your extra Rs.”+rs1);

}
else if(rs1==kababPrice)
{
System.out.println(“You have paid full Rs thanks for coming to Sarahd Hotel”);
}
break;

}

case 2:

{
Scanner input2 = new Scanner (System.in);
int rs2;
int simpleChawal=70;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+simpleChawal+”for it “);
rs2 = input2.nextInt();

if(rs2<simpleChawal)
{

System.out.println(“You entered “+rs2);
simpleChawal=simpleChawal-rs2;
System.out.println(“Please enter Rs.”+simpleChawal);

}
else if(rs2>simpleChawal)
{
rs2 = rs2-simpleChawal;

System.out.println(“Please take your extra Rs.”+rs2);

}
else if(rs2==simpleChawal)
{
System.out.println(“you paid full Rs thanks for visit here”);
}

break;
}

case 3:

{
Scanner input3 = new Scanner (System.in);
int rs3;
int chawalWithChicken=170;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+chawalWithChicken+”for it “);
rs3 = input3.nextInt();

if(rs3<chawalWithChicken)
{

System.out.println(“You entered “+rs3);
chawalWithChicken=chawalWithChicken-rs3;
System.out.println(“Please enter Rs.”+chawalWithChicken);

}
else if(rs3>chawalWithChicken)
{
rs3 = rs3-chawalWithChicken;

System.out.println(“Please take your extra Rs.”+rs3);

}
else if(rs3==chawalWithChicken)
{
System.out.println(“You entered full fee thanks for here”);
}
break;

}

case 4:

{
Scanner input4 = new Scanner (System.in);
int rs4;
int halfRoastedChicken=300;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+halfRoastedChicken+”for it “);
rs4= input4.nextInt();

if(rs4<halfRoastedChicken)
{

System.out.println(“You entered “+rs4);
halfRoastedChicken=halfRoastedChicken-rs4;
System.out.println(“Please enter Rs.”+halfRoastedChicken);

}
else if(rs4>halfRoastedChicken)
{
rs4 = rs4-halfRoastedChicken;

System.out.println(“Please take your extra Rs.”+rs4);

}
else if(rs4==halfRoastedChicken)
{
System.out.println(“You entered full fee thanks for coming here”);
}
break;

}

case 5:

{
Scanner input5 = new Scanner (System.in);
int rs5;
int fullRoastedChicken=600;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+fullRoastedChicken+”for it “);
rs5 = input5.nextInt();

if(rs5<fullRoastedChicken)
{

System.out.println(“You entered “+rs5);
fullRoastedChicken=fullRoastedChicken-rs5;
System.out.println(“Please enter Rs.”+fullRoastedChicken);

}
else if(rs5>fullRoastedChicken)
{
rs5 = rs5-fullRoastedChicken;

System.out.println(“Please take your extra Rs.”+rs5);

}
else if(rs5==fullRoastedChicken)
{
System.out.println(“You entered full Rs Thanks for Coming here”);
}
break;
}

case 6:

{
Scanner input6 = new Scanner (System.in);
int rs6;
int chickenPiece=150;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+chickenPiece+”for it “);
rs6 = input6.nextInt();

if(rs6<chickenPiece)
{

System.out.println(“You entered “+rs6);
chickenPiece=chickenPiece-rs6;
System.out.println(“Please enter Rs.”+chickenPiece);

}
else if(rs6>chickenPiece)
{
rs6 = rs6-chickenPiece;

System.out.println(“Please take your extra Rs.”+rs6);

}
else if(rs6==chickenPiece)
{
System.out.println(“You entered full fee thanks for coming here”);
}

break;
}

case 7:

{
Scanner input7 = new Scanner (System.in);
int rs7;
int vegWithSalad=80;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+vegWithSalad+”for it “);
rs7 = input7.nextInt();

if(rs7<vegWithSalad)
{

System.out.println(“You entered “+rs7);
vegWithSalad=vegWithSalad-rs7;
System.out.println(“Please enter Rs.”+vegWithSalad);

}
else if(rs7>vegWithSalad)
{
rs7 = rs7-vegWithSalad;

System.out.println(“Please take your extra Rs.”+rs7);

}
else if(rs7==vegWithSalad)
{
System.out.println(“You have placed your order you entered full fee thanks for coming here”);
}

break;
}

case 8:

{
Scanner input8 = new Scanner (System.in);
int rs8;
int pulses=40;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+pulses+”for it “);
rs8 = input8.nextInt();

if(rs8<pulses)
{

System.out.println(“You entered “+rs8);
pulses=pulses-rs8;
System.out.println(“Please enter Rs.”+pulses);

}
else if(rs8>pulses)
{
rs8 = rs8-pulses;

System.out.println(“Please take your extra Rs.”+rs8);

}
else if(rs8==pulses)
{
System.out.println(“You entered full fee you have place your order thanks for comig here”);
}

break;
}

case 9:

{
Scanner input9 = new Scanner (System.in);
int rs9;
int seekhKabab=80;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+seekhKabab+”for it “);
rs9 = input9.nextInt();

if(rs9<seekhKabab)
{

System.out.println(“You entered “+rs9);
seekhKabab=seekhKabab-rs9;
System.out.println(“Please enter Rs.”+seekhKabab);

}
else if(rs9>seekhKabab)
{
rs9 = rs9-seekhKabab;

System.out.println(“Please take your extra Rs.”+rs9);

}
else if(rs9==seekhKabab)
{
System.out.println(“You entered full fee You have placed your order thanks for being here”);
}

break;
}

case 10:

{
Scanner input10 = new Scanner (System.in);
int rs10;
int simpleBeryani=50;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+simpleBeryani+”for it “);
rs10 = input10.nextInt();

if(rs10<simpleBeryani)
{

System.out.println(“You entered “+rs10);
simpleBeryani=simpleBeryani-rs10;
System.out.println(“Please enter Rs.”+simpleBeryani);

}
else if(rs10>simpleBeryani)
{
rs10 = rs10-simpleBeryani;

System.out.println(“Please take your extra Rs.”+rs10);

}
else if(rs10==simpleBeryani)
{
System.out.println(“You entered full money You have placed your order “);
}

break;
}

case 11:

{
Scanner input11 = new Scanner (System.in);
int rs11;
int simpleBeryaniWithRiata=60;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+simpleBeryaniWithRiata+”for it “);
rs11 = input11.nextInt();

if(rs11<simpleBeryaniWithRiata)
{

System.out.println(“You entered “+rs11);
simpleBeryaniWithRiata=simpleBeryaniWithRiata-rs11;
System.out.println(“Please enter Rs.”+simpleBeryaniWithRiata);

}
else if(rs11>simpleBeryaniWithRiata)
{
rs11 = rs11-simpleBeryaniWithRiata;

System.out.println(“Please take your extra Rs.”+rs11);

}
else if(rs11==simpleBeryaniWithRiata)
{
System.out.println(“You entered wrong option please try again”);
}

break;
}

case 12:

{
Scanner input12 = new Scanner (System.in);
int rs12;
int chickenBeryani=120;
System.out.println(“You selected Chapli Kabab Please pay Rs.”+chickenBeryani+”for it “);
rs12 = input12.nextInt();

if(rs12<chickenBeryani)
{

System.out.println(“You entered “+rs12);
chickenBeryani=chickenBeryani-rs12;
System.out.println(“Please enter Rs.”+chickenBeryani);

}
else if(rs12>chickenBeryani)
{
rs12 = rs12-chickenBeryani;

System.out.println(“Please take your extra Rs.”+rs12);

}
else if(rs12==chickenBeryani)
{
System.out.println(“You entered full money YOu have placed your order tanks for here”);
}
break;

}

default:
{
System.out.println(“You have entered invalid option please try again”);
}
}

}
}

Leave a Reply

Your email address will not be published. Required fields are marked *