Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

import java.io.

*;
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");

String order= br.readLine();


System.out.println("you orderd" +" "+ order);
System.out.println("******************");
if(order.equalsIgnoreCase("pizza"))
pizza();
if(order.equalsIgnoreCase("pasta"))
pasta();
if(order.equalsIgnoreCase("starters"))
starters();
if(order.equalsIgnoreCase("dessert"))
dessert();
if(order.equalsIgnoreCase("drinks"))
drinks();
if(order.equalsIgnoreCase("offer corner"))
Offer();
if(order.equalsIgnoreCase("Create your own"))
create_own();
System.out.println("_________");
}
void pizza()throws IOException
{
char c;
int vpiz[] = {0,219,219,219,219,219};
int nvpiz[] ={0,279,279};
/*sales tax is2% for veg and 2.25% for non-veg and VAT is 12%*/

System.out.println("do you want veg/non-veg ?");


String nv=br.readLine();
if(nv.equalsIgnoreCase("veg"))
{
System.out.println("

****** THE MENU ****** ");

System.out.println("

VEG PIZZA

");

System.out.println("

PRICE ");

System.out.println("

_______ ");

System.out.println("1.veg spicy twist


System.out.println("2.farm hut
System.out.println("3.paneer & spice
System.out.println("4.italian treat

RS 219 ");
RS 219");
RS 219");
RS 219");

System.out.println("5.mushroom & corn delight


System.out.println("

RS 219");

***** THE END ******* ");

System.out.println("TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER! ");


int choice1 = Integer.parseInt(br.readLine());
System.out.println("How many do you want?");
int h=Integer.parseInt(br.readLine());
for(int i=0;i<6;i++)
{
if(choice1==i)
{
System.out.println("RS." + vpiz[i]*h);
BALANCE += vpiz[i]*h;
flag+=1;

}}
}
if(nv.equalsIgnoreCase("non veg"))
{
System.out.println("
System.out.println("

******* THE MENU ****** ");


NON-VEG

");

System.out.println("

PRICE ");

System.out.println("

______ ");

System.out.println("1.chicken mexicano

RS 279 ");

System.out.println("2.spicy chicken magic

RS 279");

System.out.println("

****** THE END ******* ");

System.out.println("TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER");


int choice2 = Integer.parseInt(br.readLine());
System.out.println("How many do you want?");
int m=Integer.parseInt(br.readLine());
for(int j=0;j<3;j++)
{
if(choice2==j)
{
System.out.println("RS." + nvpiz[j]*m);
BALANCE += nvpiz[j]*m;
flag+=1;
}}
}
System.out.println("if you want to continue press 'y' and to exit press 'e'");

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("

-------

System.out.println(" 1.Meaty Marinara

");
Family ");
------- ");
614

1047 ");

System.out.println(" 2.Baked mac n' cheese

614

System.out.println(" 3.creamy chicken alfredo


System.out.println(" 4.lasagna

676
676

1047 ");
1108 ");

1108 " );

System.out.println(" 5.Mediterranean vegetable

614

1047 ");

System.out.println(" 6.Mediterranean con pollo

676

1108 ");

System.out.println("

****************THE END******************** ");

System.out.println(" TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER!!!");


int choice3 = Integer.parseInt(br.readLine());
System.out.println("Size:Regular(1)/Fammily(2)");
int s = Integer.parseInt(br.readLine());
System.out.println("How many do you want?");
int h= Integer.parseInt(br.readLine());
for(int i=0;i<7;i++)
{
if(s==1)
{
if(choice3==i)
{
System.out.println("RS." + rpas[i]*h);
BALANCE+=rpas[i]*h;
flag+=1;
}
}
else if(s==2)
{

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 ");
----- ");

System.out.println(" 1.Chicken Caesar salad


System.out.println(" 2.caesar salad

425
305

System.out.println(" 3.Garlic bread with cheese


System.out.println(" 4.Garlic Bread

System.out.println(" 7.stuffed pizza rollers


System.out.println(" 8.oven toasted wraps
System.out.println("

552
243

425

System.out.println(" 5.Breadsticks with cheese


System.out.println(" 6.Breadsticks

799

521
336

305

490

428
790

int choice4 = Integer.parseInt(br.readLine());


System.out.println("Size:small(1)/large(2)");
int s=Integer.parseInt(br.readLine());
System.out.println("How many do you want?");
int h=Integer.parseInt(br.readLine());

{
if(s==1)

");
305

");

");
459

");

");
");
");

******************THE END******************** ");

System.out.println("TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER!!!");

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("

*****************THE MENU****************** ");

System.out.println("

DESSERTS

System.out.println("

");
PRICE ");

System.out.println(" 1. Chocochip lava

40 ");

System.out.println(" 2. Choco trafel cake

69 ");

System.out.println(" 3. Choco mousse

69 ");

System.out.println("

******************THE END******************* ");

System.out.println(" TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER!!");


int choice5 = Integer.parseInt(br.readLine());
System.out.println(" How many do you want?");
int h=Integer.parseInt(br.readLine());
for(int i=0;i<4;i++)
{

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;

int dri[] = {0,145,120,145,60,60,60,60};


System.out.println("

*****************THE MENU******************* ");

System.out.println("

DRINKS

System.out.println("

");
PRICE ");

System.out.println(" 1.Lipton Iced Tea


System.out.println(" 2.Aquafina

145
120

System.out.println(" 3.Bottled juices


System.out.println(" 4.coca cola

");
");

145
60

System.out.println(" 5.thumbs up

");
");

60

");

System.out.println(" 6.sprite

60

");

System.out.println(" 7.limca

60

");

System.out.println("

************ THE END *************

System.out.println("TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER ");


int choice = Integer.parseInt(br.readLine());
System.out.println("How many do you want");
int h=Integer.parseInt(br.readLine());
for(int i=0;i<8;i++)
{
if(choice==i)
{
System.out.println("RS." + dri[i]*h);
BALANCE+=dri[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 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};

int lc[] = {0,0,1046,1046,1231,1046};


int add[] = {0,92,123,154,185,185};
System.out.println("

******** CREATE YOUR OWN ******* ");

System.out.println(" ENTER YOUR CHOICES FROM BELOW ");


System.out.println("

System.out.println(" 1.Multigrain

243

System.out.println(" 2.Classic

L ");
922

");

922 1046 ");

System.out.println(" 3.Thin N' Crispy

922 1046 ");

System.out.println(" 4.Stuffed Crest

1046 1231 ");

System.out.println(" 5.Pan Pizza


System.out.println ("

243

552 992 1046 ");

************************************ ");

System.out.println(" Enter your choice");


int choice6 = Integer.parseInt(br.readLine());
System.out.println("Size:pieces(1)/small(2)/medium(3)/large(4)");
int s= Integer.parseInt(br.readLine());
System.out.println("How many you want ?");
int h=Integer.parseInt(br.readLine());
for(int j=0;j<6;j++)
{
if(s==1)
{
if(choice6==j)
{
t+=pc[j]*h;
System.out.println("RS." + t);

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("***********************");

System.out.println("what do you want?");


int choice10 = Integer.parseInt(br.readLine());
}
else if(choice7.equalsIgnoreCase("veggies"))
{
System.out.println("1.green pepper");
System.out.println("2.hot peppers");
System.out.println("3.tomato");
System.out.println("4.mushrooms");
System.out.println("5.red onion");
System.out.println("6.pineapples");
System.out.println("7.olives");
System.out.println("8.roasted red pepper");
System.out.println("*******************");
System.out.println("what do you want?");
int choice11 = Integer.parseInt(br.readLine());
}
else if(choice7.equalsIgnoreCase("dip it"))
{
System.out.println("1.roasted garlic");
System.out.println("2.ranch");
System.out.println("3.marinara");
System.out.println("**********");
System.out.println("what do you want?");
int choice12=Integer.parseInt(br.readLine());

}
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 ");

System.out.println(" ******************************** ");


System.out.println(" what do you want?");
int choice13=Integer.parseInt(br.readLine());
for(int k=0;k<6;k++)
{
if(choice13==k)
{
t+=add[k];
System.out.println("RS." + t);
BALANCE+=add[k];
flag+=1;
}
}
}
System.out.println("if you want to continue press 'c' and if you want 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 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

|");

System.out.println("| ITEMS BYED

|");

System.out.println("|" + flag + "


System.out.println("| TOTAL MONEY
System.out.println("| VAT added

|");
"+ BALANCE + " |");
12%

|");

System.out.println("|*******************************************|");
System.out.println("| PAYMENT SUMMARY(RS)

|");

System.out.println("| amount need to be paid "+ BALANCE+ " |");


System.out.println("| amount received from user "+ ac + " |");
System.out.println("| amount returned to user " + rt + " |");
System.out.println("|*******************************************|");
System.out.println("| items sold cannot be refunded
System.out.println("|

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();

}
}

Pixzza hut anushka

You might also like