Vous êtes sur la page 1sur 13

import java.util.*; class restaurant_project { String dish_name[];int price[];int total; String dish_name1[]=new String[20];int price1[]=new int[20]; String North_Indian[]={"1.

Dal makhani","2.Paneer butter masala","3.Chicken bharta","4.Chola bhatura","5.Pav bhaji","6.Sarso ka saag with missi roti","7.Tandoori roti","8.Rumali roti","9.Plain naan","10.Butter naan"}; int ind_price[]={175,200,210,150,160,150,5,5,5,10}; String Chinese[]={"1.Hakka noodles","2.Veg fried rice","3.Chicken fried rice","4.Chilli garlic noodles","5.Crispy chilli baby corn","6.Manchurian","7.Chilli chicken","8.Sweet corn soup","9.Chicken hot & sour soup","10.Clear soup"}; int chin_price[]={200,200,200,200,150,170,200,100,100,80}; String Mughlai[]={"1.Chicken tandoori","2.Chicken biryani","3.Mutton biryani","4.Chicken haryali kabab","5.Chicken reshmi kabab","6.Seekh kabab","7.Roghan josh","8.Tandoori roti","9.Butter naan","10.Mughali paratha"}; int mugh_price[]={200,200,200,170,170,180,150,5,10,10}; String Italian[]={"1.Braciole","2.Insalata Russa","3.Muzzarelline","4.Peperoni Imbottiti","5.Salami","6.Pasta e fagioli","7.Fonduta(fondue)","8.Stracciatella","9.Pizza marinara","10.Pizza margherita","11.Calzone","12.Pizza romana","13.Pizza ai funghi e salsicce","14.Cannelloni","15.Lasagna","16.Spaghetti","17.Tortellini","18.Penne all arrabbiata","19.Linguini with clam sauce","20.Golden delight"}; int itali_price[]={100,110,80,110,75,120,125,175,180,190,200,230,240,210,195,200,215,235,210,200}; String Continental[]={"1.Garden Salad","2.Filet Mignon","3.Chicken Tenders with fries","4.Turkey wrap","5.Barbecue Mushrooms","6.Thai Chicken lettuce wrap","7.Cottage cheese soup","8.Tyropita soup","9.Steamed Chicken Dumplings","10.Jasmine rice","11.Sesame Spinach","12.Crisp Calamari","13.Seared tuna","14.Cheese burger","15.Chicken burger"}; int cont_price[]={75,175,200,215,185,200,100,100,195,125,165,150,185,75,110}; String drinks_desserts[]={"1.Triple Chocolate Fudge cake","2.Mini chocolate mousse","3.Gourmet Turtle cheese cake","4.Friut Trifle","5.Gulab jamun","6.Espresso","7.Tea","8.Cappucino","9.Frappe coffee","10.Cola pineapple ice","11.Passion fruit blue","12.Blue lagoon","13.Somewhere over the rainbow","14.Cinderella Smile","15.Ocean green"};

int d_d_price[]={75,50,65,60,45,70,30,75,80,120,110,100,120,110,130 }; int ch=0,dish_no=0;char ans; int q[], q1[]=new int[20]; int k=0,p=0; void display(String n[],int a[]) { int l=a.length; System.out.println("Item"+"\t"+"\t"+"\t"+"\t"+"Price"); for(int i=0;i<l;i++) { System.out.println(n[i]+"\t"+"\t"+"\t"+"\t"+a[i]); } }//display

void cuisines() {System.out.println("\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"WELCOME TO THE SHACK"); System.out.println("We are a chain of multi-cuisine retaurants spread all over the country.We believe in 'DOUBLE QUALITY.DOUBLE QUANTITY.DOUBLE DELIGHT.'"); System.out.println(); do { Scanner sc=new Scanner(System.in); System.out.println("Enter a to access North Indian menu"); System.out.println("Enter b to access Chinese menu"); System.out.println("Enter c to access Mughlai menu"); System.out.println("Enter d to access Italian menu");

System.out.println("Enter e to access Continental menu"); System.out.println("Enter f to access Desserts and Drinks"); char s=sc.next().charAt(0); switch(s) { case 'a': System.out.println("you can now access the North Indian cuisine"); display(North_Indian,ind_price); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]= North_Indian[dish_no-1]; price[i]=ind_price[dish_no-1]; dish_name1[p]= North_Indian[dish_no-1]; price1[p]=ind_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i];

p++; }//for

break; case 'b': System.out.println("you can now access the Chinese cuisine"); display(Chinese,chin_price); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]= Chinese[dish_no-1]; price[i]=chin_price[dish_no-1]; dish_name1[p]= Chinese[dish_no-1]; price1[p]=chin_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i]; p++;

}//for

break; case 'c': System.out.println("you can now access the Mughlai cuisine"); display(Mughlai, mugh_price); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]=Mughlai[dish_no-1]; price[i]=mugh_price[dish_no-1]; dish_name1[p]= Mughlai[dish_no-1]; price1[p]=mugh_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i]; p++; }//for

break;

case 'd': System.out.println("you can now access the Italian cuisine"); display(Italian,itali_price); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]=Italian[dish_no-1]; price[i]=itali_price[dish_no-1]; dish_name1[p]= Italian[dish_no-1]; price1[p]=itali_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i]; p++; }//for break;

case 'e': System.out.println("you can now access the Continental cuisine"); display(Continental,cont_price ); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]= Continental[dish_no-1]; price[i]=cont_price[dish_no-1]; dish_name1[p]= Continental[dish_no-1]; price1[p]=cont_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i]; p++; }//for

break;

case 'f': System.out.println("you can now access the Desserts and Drinks"); display(drinks_desserts,d_d_price); System.out.println("Please enter the number of items you require"); ch=sc.nextInt(); q= new int[ch]; dish_name=new String[ch]; price=new int[ch]; for(int i=0;i<ch;i++) { System.out.println("Please enter the corresponding number of the dish of your choice"); dish_no=sc.nextInt(); dish_name[i]= drinks_desserts[dish_no-1]; price[i]=d_d_price[dish_no-1]; dish_name1[p]= drinks_desserts[dish_no-1]; price1[p]=d_d_price[dish_no-1]; System.out.println("Please enter the quantity required for the asked dish"); q[i]=sc.nextInt(); q1[p]=q[i]; total+=q[i]*price[i]; p++; }//for

break; default:

System.out.println("Your choice is wrong"); }//switch k=k+ch; System.out.println("Do you want to access any other cuisine? Type 'y' or 'n'"); ans=sc.next().charAt(0); } while(ans=='y' || ans=='Y'); System.out.println("Printing the bill"); bill(); }//cuisines

void bill() { int n=1; System.out.println("THE SHACK"); System.out.println("22,Murdoch Street,"); System.out.println("Lilliput 700071 "); System.out.println("____________________________________________________________________ __________________________________________________"); System.out.println("|"+"SL.NO |"+"\t"+"\t"+"QUANTITY|"+"\t"+"\t"+"ITEMS"+"\t"+"\t"+"\t"+" PRICE"+"\t"+"\t"+"\t"+"\t"+"TOTAL"+"|"); for(int i=0;i<p;i++) {

System.out.println("|"+n+"\t"+"\t"+q1[i]+"\t"+"\t"+dish_name1[i]+"|"+"\t"+"\t"+"\t"+"\t"+price1[i]+"|" +"\t"+"\t"+"\t"+"\t"+q1[i]*price1[i]+"|"); n++; }//for

System.out.println("|"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+"\t"+total+"|"); System.out.println("____________________________________________________________________ __________________________________________________"); }//bill }//class

Terminal Window
WELCOME TO THE SHACK We are a chain of multi-cuisine retaurants spread all over the country.We believe in 'DOUBLE QUALITY.DOUBLE QUANTITY.
Enter a to access North Indian menu Enter b to access Chinese menu Enter c to access Mughlai menu Enter d to access Italian menu Enter e to access Continental menu Enter f to access Desserts and Drinks f you can now access the Desserts and Drinks Item 1.Triple Chocolate Fudge cake 2.Mini chocolate mousse 3.Gourmet Turtle cheese cake Price 75 50 65

4.Friut Trifle 5.Gulab Jamun 6.Espresso 7.Tea 8.Cappucino 9.Frappe coffee 10.Cola pineapple ice 11.Passion fruit blue 12.Blue lagoon 13.Somewhere over the rainbow 14.Cinderella Smile 15.Ocean green

60 45 70 30 75 80 120 110 100 120 110 130

Please enter the number of items you require 2 Please enter the corresponding number of the dish of your choice 1 Please enter the quantity required for the asked dish 1 Please enter the corresponding number of the dish of your choice 5 Please enter the quantity required for the asked dish 1

Do you want to access any other cuisine? Type 'y' or 'n' n Printing the bill THE SHACK 22,Murdoch Street, Lilliput 700071 ___________________________________________________________________ _____________________________________________________________ SL.NO QUANTITY ITEMS PRICE TOTAL 1 1 2.Paneer butter masala 200 200

1.Triple Chocolate Fudge cake 75

75

5.Gulab jamun

45

45

_______________________________________________________________

TOTAL : VAT:12%

320 3.84

________________________________________________________________ GRAND TOTAL 323.84 ___________________________________________________________________ _____________________________________________________________

Vous aimerez peut-être aussi