0% found this document useful (0 votes)
38 views4 pages

Mini Project

The document describes a C program for a restaurant billing system created by Sandhyaa and Chandana. The program allows the user to select a meal (breakfast, lunch, or dinner), choose menu items, input quantities, and view a total bill. It contains functions for each meal type that display menus, take input, calculate costs, and allow the user to purchase additional items or exit. The main function displays an initial menu and calls the appropriate meal function based on the user's selection before terminating.

Uploaded by

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

Mini Project

The document describes a C program for a restaurant billing system created by Sandhyaa and Chandana. The program allows the user to select a meal (breakfast, lunch, or dinner), choose menu items, input quantities, and view a total bill. It contains functions for each meal type that display menus, take input, calculate costs, and allow the user to purchase additional items or exit. The main function displays an initial menu and calls the appropriate meal function based on the user's selection before terminating.

Uploaded by

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

/*MINI PROJECT*/

/*RESTAURANT BILLING SYSTEM*/


/*BY SANDHYAA AND CHANDANA*/
#include<stdio.h>
void bfast();
void lunch();
void dinner();
void exit();

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");
}

You might also like