Java Program
Java Program
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
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***
~~~~~~~~~~~~~~~~~~~~~~~~~
*****************************
SPECIAL OFFER
1 spicy veggie.1 veggie delight,1 paneer do pyasa, 1 veggie crunch worth Rs.200
Beverages
Miranda,7UP( can )
swati
Chicken Tikka
___________BILL_____________
*******
Chicken Tikka__________________>230
PEPSI_________________________>20
Total Price="+"__________________>435
Total amount="+"__________________>210.0
Discount 10%"+"__________________>21.0
~~~~~~~~~~~~~~~~~~~
********************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~