0% found this document useful (0 votes)
36 views27 pages

Java Program

The document describes a pizza ordering program with the following steps: 1. It welcomes the customer and displays the menu. 2. It asks for the customer's name and item selections. 3. It calculates the total bill and displays the itemized receipt.

Uploaded by

hemant goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views27 pages

Java Program

The document describes a pizza ordering program with the following steps: 1. It welcomes the customer and displays the menu. 2. It asks for the customer's name and item selections. 3. It calculates the total bill and displays the itemized receipt.

Uploaded by

hemant goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

PIZA HUT

ALGORITHM
STEP- 1:
The program will welcome the customer and show the Menu
Card.
STEP- 2:
It will ask the customer to enter the name of the customer.
STEP- 3:
It will ask to enter the item’s name and enter the choices.
STEP- 4:
It will again ask to enter 1 for more.
STEP- 5:
At last, it will show the bill details.

PROGRAM
import java.lang.* ;
import java.io.* ;
public class swati
{
public static void main(String args[])throws IOException
{
int F=0,ac;
int h;
String ab;
do
{
System.out.println(" * **WELCOME TO PIZAHUT***");
System.out.println(" ~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println();
System.out.println(" PAN & STUFFED CRUST MENU");
System.out.println(" *****************************");
System.out.println();
String it[]=new String[50];
int ct[]=new int[50];
System.out.println("SPECIAL OFFER");
System.out.println("_______________");
System.out.println("1 spicy veggie.1 veggie delight,1 paneer do pyasa, 1 veggie

crunch worth Rs.200");


System.out.println();
System.out.println();
System.out.println("Pay Rs. More and get 4flavours of creambell
icecream");
System.out.println();
System.out.println();
System.out.println(" Vegetarian Personal Medium Large");
System.out.println();
System.out.println("Simply Veg Rs.50 Rs.90 Rs.195");
System.out.println("Veggie Crunch Rs.50 Rs.95 Rs.195");
System.out.println("Cheezy Cheeze Rs.70 Rs.130 Rs.230")
System.out.println("Veggie Lovers Rs.70 Rs.130 Rs.230");
System.out.println("Spicy Indian Rs.70 Rs.130 Rs.230");
System.out.println("Country Feast Rs.95 Rs.85 Rs.230");
System.out.println("Spicy paneer Rs.95 Rs.185 Rs.285");
System.out.println( "Veggie Supreme Rs.95 Rs.185 Rs.285");
System.out.println("Exotica Rs.95 Rs.185 Rs.285");
System.out.println("Veggie Tama Tam Rs.70 Rs.130 Rs.230");
System.out.println("Paneer Punjabi Rs.95 Rs.185 Rs.280");
System.out.println();
System.out.println();
System.out.println("```Non-Veg``` Personal Medium Large");
System.out.println("Teekha Chicken Rs70 Rs.130 Rs.230");
System.out.println("Chicken tikka Rs.90 Rs.175 Rs.275");
System.out.println("Chicken 'n' Spicy Rs.90 Rs.175 Rs.275");
System.out.println("Chicken Supreme Rs.110 Rs.195 Rs.295");
System.out.println("Pepperoni Rs.110 Rs.195 Rs.295");
System.out.println("Supreme Rs.110 Rs.195 Rs.295");
System.out.println("Murg mazedar Rs.90 Rs.175 Rs.275");
System.out.println("Supreme tandoori Rs.110 Rs.195 Rs.295");
System.out.println();
System.out.println();
System.out.println("Beverages");
System.out.println("Pepsi,Diet pepsi(500 ml bottle)");
System.out.println("Miranda,7UP( can)");
System.out.println("Beverages to be sold on M.R.P");
System.out.println();
BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
System.out.println();
System.out.println("Enter your name plz");
String nam=buf.readLine();
System.out.println();
System.out.println();
int i=0,S=0;
do
{
System.out.println ("Enter the item name ");
String x=buf.readLine();
it[i]=x;
if(x.equalsIgnoreCase("Simply Veg")==true)
{
F=1;
System.out.println("Enter 1 for personal");

System.out.println("Enter 2 for medium");


System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:
ct[i]=50;
S=S+50;
break;
case 2:ct[i]=95;
S=S+95;
break;
case 3:ct[i]=195;
S=S+195;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Veggie Crunch")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=50;
S=S+50;
break;
case 2:ct[i]=95;
S=S+95;
break;
case 3:ct[i]=195;
S=S+195;
break;
default:System.out.println("Wrong choice");
}
}
if(x . equalsIgnoreCase("Cheezy cheese")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");

System.out.println("Enter 3 for Large");


System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=70;
S=S+70;
break;
case 2:ct[i]=130;
S=S+130;
break;
case 3:ct[i]=230;
S=S+230;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Veggie Lovers")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("enter 2 for medium");
System.out.println("enter 3 for large");
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:
ct[i]=70;
S=S+70;
break;
case 2:
ct[i]=130;
S=S+130;
break;
case 3:
ct[i]=230;
S=S+230;
break;
default:System.out.println("WRONG CHOICE");
}
}
if(x.equalsIgnoreCase("Special offer")==true)
{
F=1;
S=S+200;
ct[i]=200;
}
if(x.equalsIgnoreCase("Spicy Indian")==true)
{

F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=70;
S=S+70;
break;
case 2:ct[i]=130;
S=S+130;
break;
case 3:ct[i]=230;
S=S+230;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Country Feast")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;
S=S+90;
break;
case 2:ct[i]=185;
S=S+185;
break;
case 3:ct[i]=285;
S=S+285;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Spicy Paneer")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;
S=S+90;
break;
case 2:ct[i]=185;
S=S+185;
break;
case 3:ct[i]=285;
S=S+285;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Veggie Supreme")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=95;
S=S+95;
break;
case 2:ct[i]=185;
S=S+185;
break;
case 3:ct[i]=285;
S=S+285;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Exotica")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();

String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=110;
S=S+110;
break;
case 2:ct[i]=195;
S=S+195;
break;
case 3:ct[i]=295;
S=S+295;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Veggie Tama-Tam")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=70;
S=S+70;
break;
case 2:ct[i]=130;
S=S+130;
break;
case 3:ct[i]=230;
S=S+230;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Paneer Punjabi")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);

switch(ch)
{
case 1:ct[i]=95;
S=S+95;
break;
case 2:ct[i]=185;
S=S+185;
break;
case 3:ct[i]=280;
S=S+280;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Teekha Chicken")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=70;
S=S+70;
break;
case 2:ct[i]=130;
S=S+130;
break;
case 3:ct[i]=230;
S=S+230;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Chicken tikka")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;

S=S+90;
break;
case 2:ct[i]=175;
S=S+175;
break;
case 3:ct[i]=275;
S=S+275;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Chicken ‘n’ Spicy")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;
S=S+90;
break;
case 2:ct[i]=175;
S=S+175;
break;
case 3:ct[i]=275;
S=S+275;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Chicken Supreme")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=110;
S=S+110;
break;
case 2:ct[i]=195;

S=S+195;
break;
case 3:ct[i]=295;
S=S+295;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Pepperoni")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=110;
S=S+110;
break;
case 2:ct[i]=195;
S=S+195;
break;
case 3:ct[i]=295;
S=S+295;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Supreme")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=110;
S=S+110;
break;
case 2:ct[i]=195;
S=S+195;
break;

case 3:ct[i]=295;
S=S+295;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Murg mazedar")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;
S=S+90;
break;
case 2:ct[i]=175;
S=S+175;
break;
case 3:ct[i]=275;
S=S+275;
break;
default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Supreme Tandoori")==true)
{
F=1;
System.out.println("Enter 1 for personal");
System.out.println("Enter 2 for medium");
System.out.println("Enter 3 for Large");
System.out.println();
String c=buf.readLine();
int ch=Integer.parseInt(c);
switch(ch)
{
case 1:ct[i]=90;
S=S+90;
break;
case 2:ct[i]=175;
S=S+175;
break;
case 3:ct[i]=275;
S=S+275;
break;

default:System.out.println("Wrong choice");
}
}
if(x.equalsIgnoreCase("Pepsi")==true)
{
F=1;
S=S+20;
ct[i]=20;
}
if(x.equalsIgnoreCase("Diet Pepsi")==true)
{
F=1;
S=S+20;
ct[i]=20;
}
if(x.equalsIgnoreCase("Miranda")==true)
{
F=1;
S=S+25;
ct[i]=25;
}
if(x.equalsIgnoreCase("7UP")==true)
{
F=1;
S=S+25;
ct[i]=25;
}
if (F==0)
{
System.out.println("plz check the spelling of the item or the item is not
available");
System.out.println("******* SORRY !**********");
}
System.out.println("If you want more enter 1 ");
String y=buf.readLine();
h=Integer.parseInt(y);
i++;
}while(h==1);
System.out.println();
System.out.println("___________BILL_____________");
System.out.println(" ******* ");
System.out.println();
System.out.println(" "+nam);
System.out.println("~~~~~~~~~~~~~");
for(int g=0;g<=i-1;g++)
{
System.out.println();
System.out.println(it[g]+"___________>"+ct[g]);
}
System.out.println("Total Price="+"__________________>"+S);

System.out.println();
double q=5.0/100*S;
System.out.println("Sales Tax
5%"+"__________________>"+q);
System.out.println();
double w=S+q;
System.out.println("Total
amount="+"__________________>"+w);
System.out.println();
double r=10.0/100*w;
System.out.println("Discount
10%"+"__________________>"+r);
System.out.println();
double t=w-r;
System.out.println("Net Amount __________________>"+t);
System.out.println();
System.out.println();
System.out.println();
System.out.println("Is there any more customer");
System.out.println("If yes enter 2,if no enter 1");
ab=buf.readLine();
ac=Integer.parseInt(ab);
}
while(ac==2);
System.out.println(" THANKS FOR YOUR VISIT");
System.out.println(" ~~~~~~~~~~~~~~~~~~~`");
System.out.println();
System.out.println(" HOPE YOU ENJOYED THE SERVICE");
System.out.println(" *********************************");
System.out.println();
System.out.println("WAITING FOR YOUR NEXT VISIT");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println();
}
}

OUTPUT
* **WELCOME TO PIZAHUT***

~~~~~~~~~~~~~~~~~~~~~~~~~

PAN & STUFFED CRUST MENU

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

SPECIAL OFFER

1 spicy veggie.1 veggie delight,1 paneer do pyasa, 1 veggie crunch worth Rs.200

Pay Rs. More and get 4flavours of creambell icecream

Vegetarian Personal Medium Large

Simply Veg Rs.50 Rs.90 Rs.195

Veggie Crunch Rs.50 Rs.95 Rs.195

Cheezy Cheeze Rs.70 Rs.130 Rs.230

Veggie Lovers Rs.70 Rs.130 Rs.230

Spicy Indian Rs.70 Rs.130 Rs.230


Country Feast Rs.95 Rs.85 Rs.230

Spicy paneer Rs.95 Rs.185 Rs.285

Veggie Supreme Rs.95 Rs.185 Rs.285

Exotica Rs.95 Rs.185 Rs.285

Veggie Tama Tam Rs.70 Rs.130 Rs.230

Paneer Punjabi Rs.95 Rs.185 Rs.280

Non-Veg``` Personal Medium Large

Teekha Chicken Rs70 Rs.130 Rs.230

Chicken tikka Rs.90 Rs.175 Rs.275

Chicken 'n' Spicy Rs.90 Rs.175 Rs.275

Chicken Supreme Rs.110 Rs.195 Rs.295

Pepperoni Rs.110 Rs.195 Rs.295

Supreme Rs.110 Rs.195 Rs.295

Murg mazedar Rs.90 Rs.175 Rs.275

Supreme tandoori Rs.110 Rs.195 Rs.295

Beverages

Pepsi,Diet pepsi(500 ml bottle

Miranda,7UP( can )

Beverages to be sold on M.R.P

Enter your name plz

swati

Enter the item name

Chicken Tikka

Enter 1 for personal

Enter 2 for medium

Enter 3 for Large

If you want more enter 1

___________BILL_____________

*******
Chicken Tikka__________________>230

PEPSI_________________________>20

Total Price="+"__________________>435

Sales Tax 5%"+"__________________>10.0

Total amount="+"__________________>210.0

Discount 10%"+"__________________>21.0

Net Amount __________________>189.0

Is there any more customer

If yes enter 2,if no enter 1

THANKS FOR YOUR VISIT

~~~~~~~~~~~~~~~~~~~

HOPE YOU ENJOYED THE SERVICE

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

WAITING FOR YOUR NEXT VISIT

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy