java project pizza hut
TRANSCRIPT
-
8/10/2019 java project pizza hut
1/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");
-
8/10/2019 java project pizza hut
2/30
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%*/
-
8/10/2019 java project pizza hut
3/30
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 RS 219 ");
System.out.println("2.farm hut RS 219");
System.out.println("3.paneer & spice RS 219");
System.out.println("4.italian treat RS 219");
System.out.println("5.mushroom & corn delight RS 219");
System.out.println(" ***** 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
-
8/10/2019 java project pizza hut
4/30
}}
}
if(nv.equalsIgnoreCase("non veg"))
{
System.out.println(" ******* THE MENU ****** ");
System.out.println(" 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
-
8/10/2019 java project pizza hut
5/30
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(" **************THE MENU*****************");
System.out.println(" TUSCANI PASTAS ");
System.out.println(" Regular Family ");
System.out.println(" ------- ------- ");
System.out.println(" 1.Meaty Marinara 614 1047 ");
-
8/10/2019 java project pizza hut
6/30
System.out.println(" 2.Baked mac n' cheese 614 1047 ");
System.out.println(" 3.creamy chicken alfredo 676 1108 ");
System.out.println(" 4.lasagna 676 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
-
8/10/2019 java project pizza hut
7/30
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
{
-
8/10/2019 java project pizza hut
8/30
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 Large ");
System.out.println(" ----- ----- ");
System.out.println(" 1.Chicken Caesar salad 425 799 ");
System.out.println(" 2.caesar salad 305 552 ");
System.out.println(" 3.Garlic bread with cheese 243 305 ");
System.out.println(" 4.Garlic Bread 425 521 ");
System.out.println(" 5.Breadsticks with cheese 336 459 ");
System.out.println(" 6.Breadsticks 305 490 ");
System.out.println(" 7.stuffed pizza rollers 428 ");
System.out.println(" 8.oven toasted wraps 790 ");
System.out.println(" ******************THE END******************** ");
System.out.println("TYPE THE SERIAL NUMBER TO GIVE YOUR ORDER!!!");
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());
for(int i=0;i
-
8/10/2019 java project pizza hut
9/30
{
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();
-
8/10/2019 java project pizza hut
10/30
}
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
-
8/10/2019 java project pizza hut
11/30
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;
-
8/10/2019 java project pizza hut
12/30
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 145 ");
System.out.println(" 2.Aquafina 120 ");
System.out.println(" 3.Bottled juices 145 ");
System.out.println(" 4.coca cola 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/10/2019 java project pizza hut
13/30
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");
-
8/10/2019 java project pizza hut
14/30
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);
}
-
8/10/2019 java project pizza hut
15/30
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};
-
8/10/2019 java project pizza hut
16/30
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(" P S M L ");
System.out.println(" 1.Multigrain 243 922 ");
System.out.println(" 2.Classic 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 243 552 992 1046 ");
System.out.println (" ************************************ ");
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
-
8/10/2019 java project pizza hut
17/30
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)
-
8/10/2019 java project pizza hut
18/30
{
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
-
8/10/2019 java project pizza hut
19/30
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("***********************");
-
8/10/2019 java project pizza hut
20/30
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());
-
8/10/2019 java project pizza hut
21/30
}
else if(choice7.equalsIgnoreCase("additional toppings"))
{
System.out.println(" 1.Personal RS.92");
System.out.println(" 2.Small RS.123");
System.out.println(" 3.Medium RS.154 ");
System.out.println(" 4.Large RS.185 ");
System.out.println(" 5.Panormous RS.185 ");
System.out.println(" ******************************** ");
System.out.println(" what do you want?");
int choice13=Integer.parseInt(br.readLine());
for(int k=0;k
-
8/10/2019 java project pizza hut
22/30
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()
-
8/10/2019 java project pizza hut
23/30
{
System.out.println("|-------------------------------------------|");
System.out.println("| PIZZA HUT |");
System.out.println("| ITEMS BYED |");
System.out.println("|" + flag + " |");
System.out.println("| TOTAL MONEY "+ BALANCE + " |");
System.out.println("| VAT added 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();
-
8/10/2019 java project pizza hut
24/30
}
}
Pixzza hut anushka
-
8/10/2019 java project pizza hut
25/30
-
8/10/2019 java project pizza hut
26/30
-
8/10/2019 java project pizza hut
27/30
-
8/10/2019 java project pizza hut
28/30
-
8/10/2019 java project pizza hut
29/30
b
-
8/10/2019 java project pizza hut
30/30