Mini Project
Mini Project
float total;
char choice;
int again;
void main()
{
char choice=' ';
printf(" WELCOME TO DE GRAND RESTAURANT \n");
printf(" ==================================== \n\n");
printf("Please enter the meal that you would like to purchase\n\n");
printf("[A]Breakfast\n");
printf("[B]Lunch\n");
printf("[C]Dinner\n");
printf("[D]Exit\n\n");
printf("Enter your choice here:");
scanf("%c",&choice);
if(choice=='A')
{
bfast();
}
else if(choice=='B')
{
lunch();
}
else if(choice=='C')
{
dinner();
}
else if(choice=='D')
{
exit();
}
}
void bfast()
{
int choice=0;
int quantity=0;
int again=0;
printf(" WELCOME TO DE GRAND RESTAURANT \n");
printf(" ==================================== \n\n");
printf(" BREAKFAST MENU \n");
label:
printf(" Please enter the food u would like to purchase \n");
printf(" [1]Toast-50\n");
printf(" [2]pancakes-100\n");
printf(" [3]oatmeal-100\n");
printf("Enter your choice here:");
scanf("%d",&choice);
if(choice==1)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=50*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label;
}
else
{
exit();
}
}
else if(choice==2)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=100*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label;
}
else
{
exit();
}
}
else if(choice==3)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=100*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label;
}
else
{
exit();
}
}
}
void lunch()
{
int choice=0;
int quantity=0;
int again=0;
printf(" WELCOME TO DE GRAND RESTAURANT \n");
printf(" ==================================== \n\n");
printf(" LUNCH MENU \n");
label1:
printf(" Please enter the food u would like to purchase \n");
printf(" [1]Chicken sandwich-100\n");
printf(" [2]Bacon cheddar burger-150\n");
printf(" [3]Crispy honey chicken salad-200\n");
printf("Enter your choice here:");
scanf("%d",&choice);
if(choice==1)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=100*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label1;
}
else
{
exit();
}
}
else if(choice==2)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=150*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label1;
}
else
{
exit();
}
}
else if(choice==3)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=200*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label1;
}
else
{
exit();
}
}
}
void dinner()
{
int choice=0;
int quantity=0;
int again=0;
printf(" WELCOME TO DE GRAND RESTAURANT \n");
printf(" ==================================== \n\n");
printf(" DINNER MENU \n");
label2:
printf(" Please enter the food u would like to purchase \n");
printf(" [1]Meat loaf plate-150\n");
printf(" [2]Hot turkey plate-180\n");
printf(" [3]Fried chicken and waffle-200\n");
printf("Enter your choice here:");
scanf("%d",&choice);
if(choice==1)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=150*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould` you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label2;
}
else
{
exit();
}
}
if(choice==2)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=180*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label2;
}
else
{
exit();
}
}
if(choice==3)
{
printf("Enter the quantity:");
scanf("%d",&quantity);
total+=200*quantity;
printf("your total amt is Rs%f,please pay at the counter\n\n",total);
printf("\nWould you like to buy anything else? [1]YES,[2]NO:");
scanf("%d",&again);
if(again==1)
{
goto label2;
}
else
{
exit();
}
}
}
void exit()
{
printf(" THANK YOU VERY MUCH\n");
printf(" PLEASE COME AGAIN \n");
}