Java Project Pizza Hut
Java Project Pizza Hut
*;
import java.util.Scanner;
class pizza_hut
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
Scanner sc = new Scanner(System.in);
int BALANCE = 0;int flag;int ac=0,rt=0;
void begin()throws IOException
{
System.out.println("WELCOME TO PIZZA HUT! ");
System.out.println("**********************");
System.out.println(" Hello! Customer");
System.out.println("****************");
System.out.println("What do you want to order?");
System.out.println("The Menu is");
System.out.println("******");
System.out.println("pizza");
System.out.println("pasta");
System.out.println("Starters");
System.out.println("Dessert");
System.out.println("Drinks");
System.out.println("Offer corner");
System.out.println("Create your own");
System.out.println("**************");
System.out.println("choose");
System.out.println("
VEG PIZZA
");
System.out.println("
PRICE ");
System.out.println("
_______ ");
RS 219 ");
RS 219");
RS 219");
RS 219");
RS 219");
}}
}
if(nv.equalsIgnoreCase("non veg"))
{
System.out.println("
System.out.println("
");
System.out.println("
PRICE ");
System.out.println("
______ ");
System.out.println("1.chicken mexicano
RS 279 ");
RS 279");
System.out.println("
do
{
c= (char)br.read();
if(c=='y')
{
System.out.println("ok!!");
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!=' ');
}
void pasta()throws IOException
{
char c;
int rpas[] = {0,614,614,676,676,614,676};
int lpas[] = {0,1047,1047,1108,1108,1047,1108};
System.out.println("
System.out.println("
**************THE MENU*****************");
TUSCANI PASTAS
System.out.println("
Regular
System.out.println("
-------
");
Family ");
------- ");
614
1047 ");
614
676
676
1047 ");
1108 ");
1108 " );
614
1047 ");
676
1108 ");
System.out.println("
if(choice3==i)
{
System.out.println("RS." + lpas[i]*h);
BALANCE+=lpas[i]*h;
flag+=1;
}
}
}
System.out.println("if you want to continue press 'c'to exit press 'e'");
do
{
c=(char) br.read();
if(c=='c')
{
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!=' ' );
}
void starters()throws IOException
{
char c;
int sstar[] = {0,425,305,243,425,336,305,428,790};
int lstar[] = {0,799,552,305,521,459,490,0,0};
System.out.println("
****************THE MENU*******************");
System.out.println("
STARTERS
");
System.out.println("
Small
System.out.println("
-----
Large ");
----- ");
425
305
552
243
425
799
521
336
305
490
428
790
{
if(s==1)
");
305
");
");
459
");
");
");
");
for(int i=0;i<9;i++)
");
{
if(choice4==i)
{
System.out.println("RS." + sstar[i]*h);
BALANCE+=sstar[i]*h;
flag+=1;
}
}
else if(s==2)
{
if(choice4==i)
{
System.out.println("RS." + lstar[i]*h);
BALANCE+= lstar[i]*h;
flag+=1;
}
}
}
System.out.println("if you want to continue 'c' to exit 'e'");
do
{
c=(char)br.read();
if(c=='c')
{
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!= ' ');
}
void dessert()throws IOException
{
char c;
int des[]= {0,40,69,69};
System.out.println("
System.out.println("
DESSERTS
System.out.println("
");
PRICE ");
40 ");
69 ");
69 ");
System.out.println("
if(choice5==i)
{
System.out.println("RS." + des[i]*h);
BALANCE+= des[i]*h;
flag+=1;
}
}
System.out.println("if you want to continue press 'c' and to exit press 'e'");
do
{
c=(char)br.read();
if(c=='c')
{
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!=' ');
}
void drinks()throws IOException
{
char c;
System.out.println("
DRINKS
System.out.println("
");
PRICE ");
145
120
");
");
145
60
System.out.println(" 5.thumbs up
");
");
60
");
System.out.println(" 6.sprite
60
");
System.out.println(" 7.limca
60
");
System.out.println("
");
System.out.println("if you want to continue press 'c' and to exit press 'e'");
do
{
c=(char)br.read();
if(c=='c')
{
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!=' ' );
}
void Offer()
{
int t=0;
System.out.println("Pizza Hut brings you delicious offers! Enjoyy");
System.out.println("Enter which day it is");
System.out.println("press 1. Monday");
System.out.println("press 2. Tuesday");
System.out.println("press 3. Wednesday");
System.out.println("press 4. Thursday");
System.out.println("press 5. Friday");
System.out.println("Enter");
int d = sc.nextInt();
switch(d)
{
case 1:
{
System.out.println(" TODAYS OFFER IS 1 medium pizza + 2 small pizzas at rs.182");
BALANCE+=182;
t+= 182;
System.out.println("you need topay rs." + t);
}
break;
case 2:{
System.out.println(" TODAYS OFFER IS 35% OFF! meal for 4 @rs.599");
BALANCE+=599;
t+=599;
System.out.println("YOU NEED TO PAY RS." + t);
}
break;
case 3:{
System.out.println(" TODAYS OFFER IS 2 mediu pizzas or 2 baked pasta & 1 medium pizza,any garli
bread(4 pieces)& 2 dessert at rs.599 ");
BALANCE+=599;
t+=599;
System.out.println("you need to pay rs." + t);
}
break;
case 4:{
System.out.println("TODAYS OFFER IS 3 Course meal for 2 @rs.379 (1 medium pizza + 1 garlic bread + 1
pepsi)");
BALANCE+=379;
t+=379;
System.out.println("you need to pay rs." + t);
}
break;
case 5:{
System.out.println("TODAYS OFFER IS @RS.600 on any family pizza with any medium pizza orderd ");
BALANCE+=600;
t+=600;
System.out.println("you need to pay rs." + t);
}
break;
default:System.out.println("Wrong Input");
}
}
void create_own()throws IOException
{
char c;
int t=0;
int pc[] = {0,243,0,0,0,243};
int sc[] = {0,0,0,0,0,552};
int mc[] = {0,922,922,922,1046,992};
System.out.println(" 1.Multigrain
243
System.out.println(" 2.Classic
L ");
922
");
243
************************************ ");
BALANCE+=pc[j]*h;
flag+=1;
}
}
else if(s==2)
{
if(choice6==j)
{
t+=sc[j]*h;
System.out.println("RS." + sc[j]);
BALANCE+=sc[j]*h;
flag+=1;
}
}
else if(s==3)
{
if(choice6==j)
{
t+=mc[j]*h;
System.out.println("RS." + mc);
BALANCE+=mc[j]*h;
flag+=1;
}
}
else if(s==4)
{
if(choice6==j)
{
t+=lc[j]*h;
System.out.println("RS." + t);
BALANCE+= lc[j]*h;
flag+=1;
}
}
}
String shwmenu[] = {"cheese","Sauces","Meats","veggies","Dip_it","Additional_toppings"};
System.out.println("Do you want to add toppings? (yes/no)");
String ans=br.readLine();
if(ans.equalsIgnoreCase("yes"))
{
for(int i = 0;i<6;i++)
{
System.out.println(shwmenu[i]);
}}
else if(ans.equalsIgnoreCase("no"))
{
System.out.println("OK!");
}
System.out.println("what do you choose?");/*name it*/
String choice7 = br.readLine();
if(choice7.equalsIgnoreCase("cheese"))
{
System.out.println("1.Extra pizza mozarella");
System.out.println("2.feta");
System.out.println("3.parmesan");
System.out.println("what do you want?");
int choice8= Integer.parseInt(br.readLine());
}
else if(choice7.equalsIgnoreCase("Sauces"))
{
System.out.println("1.tomato");
System.out.println("2.alfredo");
System.out.println("3.pesto");
System.out.println("what do you want");
int choice9 = Integer.parseInt(br.readLine());
}
else if(choice7.equalsIgnoreCase("meats"))
{
System.out.println("1.pepperoni");
System.out.println("2.Italian Sausage");
System.out.println("3.mild sausage");
System.out.println("4.ham");
System.out.println("5.beef topping");
System.out.println("6.grilled chicken breast");
System.out.println("***********************");
}
else if(choice7.equalsIgnoreCase("additional toppings"))
{
System.out.println(" 1.Personal
System.out.println(" 2.Small
System.out.println(" 3.Medium
System.out.println(" 4.Large
System.out.println(" 5.Panormous
RS.92");
RS.123");
RS.154 ");
RS.185 ");
RS.185 ");
c=(char)br.read();
if(c=='c')
{
begin();
}
else if(c=='e')
{
System.out.println("you dont want to buy anymore!");
show();
}
}while(c!=' ' );
}
void accept(int a)
{
ac=a;
}
void returnd(int r)
{
rt=BALANCE-ac;
}
void show()
{
System.out.println("you need to pay rs." + BALANCE );
}
void bill()
{
System.out.println("|-------------------------------------------|");
System.out.println("|
PIZZA HUT
|");
|");
|");
"+ BALANCE + " |");
12%
|");
System.out.println("|*******************************************|");
System.out.println("| PAYMENT SUMMARY(RS)
|");
THANK YOU!!!
System.out.println("|
VISIT AGAIN!!
|");
|");
|");
System.out.println("|*******************************************|");
System.out.println("|
BYE!!
|");
System.out.println("|-------------------------------------------|");
}
public static void main(String args[])throws IOException
{
pizza_hut obj = new pizza_hut();
obj.begin();
obj.bill();
}
}