cafeteria info management system
DESCRIPTION
TRANSCRIPT
![Page 1: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/1.jpg)
BY :-
CHENDIKA VAMSI KRISHNA
G.ESWARA MOORTI
GAURAV SUBHAM
GAURAV KAUSHIK
GAURAV RAJ KHAIWAL
GAURAV SHARMA
GAURAV KUMAR SHARMA
GAUTAM AHUJA
GOURAV CHOKROBARTY
GUNJAN TYAGI
HARSHA MEHRA
CAFETERIA INFO MANAGEMENT SYSTEM
![Page 2: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/2.jpg)
CAFETERIA INFO MANAGEMENT SYSTEM
It is database to maintain the records of all items such as the no. of items, its price, its quantity and other details related to those items. In CIMS we also maintain the record of employees and other detail related to them.
![Page 3: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/3.jpg)
USE OF CIMS
It helps us to maintain the record of everything present in cafeteria, and also to maintain records easily without being messed up and thus reduce the time consumption.
![Page 4: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/4.jpg)
LIST OF VARIABLES
In cafeteria info management system, we make use of the following variables:
1. TYPE OF THE MEAL (sandwiches/patties/beverages): int type
2. NAME OF THE MEAL: character type
3. QUANTITY OF THE MEAL: int type
4. COST OF THE MEAL: int type
5. TAX ON THE MEAL: int type
6. CATEGORY OF THE EMPLOYEES (manager/subordinates/guard): character type
7. NUMBER OF PEOPLE IN EACH CATEGORY: int type
8. SALARY OF THE EMPLOYEES: int type.
![Page 5: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/5.jpg)
SOFTWARE USED:
Operating system : Microsoft XP/Windows 7 Platform : C Language( 32 bits)
Application Software : MS Office 2007/11
![Page 6: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/6.jpg)
CODING#include<stdio.h>#include<conio.h>#include<string.h>
'#' is a symbol that says "next instruction is for pre-processor, not compiler".
Stdio.h is C program header file which contain printf and scanf.. It is standard header file.
conio.h is Turbo C++ header file from Borland.. Its a non standard header file..used for clrscr(), getch() functions..
![Page 7: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/7.jpg)
float price[7] = {25.00,50.00,20.00,50.00,40.00,60.00,40.00 };float mealTaxPrices[7];int persons;
void printMeals();
void orderMeals();
Void order();
void salary();
int main()
{
char response = 'y', ch;
printMeals();
while(response == 'y')
![Page 8: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/8.jpg)
{ PRINTF("PLEASE ENTER NUMBER OF PERSONS :"); SCANF("%D",&PERSONS); ORDERMEALS(); PRINTF("\NWOULD YOU LIKE TO CONTINUE(Y/N):"); SCANF("\N%C",&RESPONSE); }PRINTF("\N ******************** THANK YOU FOR COMING *************************\N");
PRINTF("WANT TO SEE SALARIES???");SCANF("%C", &CH); IF(CH=='Y'||CH=='Y') SALARY(); RETURN 0; GETCH();}
![Page 9: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/9.jpg)
‘|| ‘ represent OR operator ,will be executed even if any one of the condition will be true
void printMeals();void orderMeals();
the above both represents function definition.while(response == 'y')
WHILE STATEMENT
is used to execute the set of statement repeatedly till the condition is specified remains true.
![Page 10: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/10.jpg)
VOID PRINTMEALS(){ PRINTF("\******** WELCOME TO CSE RESTURANT *******\N"); PRINTF(" \T\T\T BELOW IS THE MENU\T\T\T"); PRINTF(" \T\T\T\T\T MEALS\T\T\TPRICE:\N"); PRINTF(" \T\T\T 1- VEG BURGER\T\TRS.25\N"); PRINTF(" \T\T\T 2-CHICK.BURGER\T\TRS.50\N"); PRINTF(" \T\T\T 3- VEG PATTIES\T\TRS.20\N"); PRINTF(" \T\T\T 4- CHICK.PATTIES\TRS.50\N"); PRINTF(" \T\T\T 5- SANDWICH\T\TRS.40\N"); PRINTF(" \T\T\T 6- PEPSI\T\TRS.60\N"); PRINTF(" \T\T\T 7- FANTA\T \TRS.40\N"); PRINTF("\N");}
![Page 11: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/11.jpg)
![Page 12: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/12.jpg)
When the function void printMeals() is called it will diplay the above menu list.
void orderMeals()
{
float totalPrice;
float Payment,discount;
printf(" \t\tORDER MENU\n");
totalPrice = order();
Payment = totalPrice ;
printf(" \t\t ** final BILL ** \n");
printf(" \t\t\tperson\t\t%d\t\t%5.2f\n",persons,totalPrice);
printf(" \t\t\tTotal bill\t\t\t%5.2f\n",Payment );
![Page 13: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/13.jpg)
![Page 14: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/14.jpg)
if(Payment < 10)
discount=((Payment * 0.5)/100);
else if(Payment>= 10 && Payment<20)
discount=((Payment * 1)/100);
else if(Payment>= 20 && Payment<30)
discount=((Payment * 1.5)/100);
else if(Payment>= 30 && Payment<40)
discount=((Payment * 2.0)/100);
else
discount= ((Payment * 5.0)/100);
printf(" \t\t\tTotal bill after discount\t%5.2f\n",discount);
}
In the nested if else, the discount will be given based on the given conditions.
![Page 15: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/15.jpg)
int order()
{
int menuOption,i,amount;
char response = 'y';
int totalPerPerson = 0,totalAllPerson = 0;
int tax = 5;
if(persons <=0)
printf("\n ");
else
for(i=0;i<persons;i++)
{
printf("person %d please enter your orders\n",i+1);
while(response == 'y')
![Page 16: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/16.jpg)
{ PRINTF("PLEASE ENTER YOUR OPTION:"); SCANF("%D",&MENUOPTION);
IF(MENUOPTION<1 || MENUOPTION>7) { PRINTF("SORRY WE DON`T HAVE THIS ORDER \NAGAIN! "); CONTINUE; }
PRINTF("PLEASE ENTER YOUR AMOUNT OF ORDER:"); SCANF("%D",&AMOUNT); TOTALPERPERSON = TOTALPERPERSON +(AMOUNT * PRICE[MENUOPTION - 1] ); PRINTF("\NWOULD YOU LIKE TO ENTER MORE ORDERS(Y/N):"); SCANF("\N%C",&RESPONSE);
![Page 17: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/17.jpg)
} PRINTF("\N"); TOTALALLPERSON +=TOTALPERPERSON; TOTALPERPERSON = 0; RESPONSE = 'Y'; } RETURN TOTALALLPERSON + ((TOTALALLPERSON * TAX) / 100); }
VOID SALARY(){ CHAR CH; FILE *PTR; PTR=FOPEN("SALARY.TXT","R"); IF(PTR==NULL)
![Page 18: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/18.jpg)
OUTPUT
![Page 19: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/19.jpg)
{PRINTF("SORRY !!!! THE SPECIFIED FILE WAS NOT FOUND IN SYSTEM ");
}WHILE(!FEOF(PTR))
{CH=FGETC(PTR);PRINTF("%C", CH);
}FCLOSE(PTR);
}
FILE *PTR; REPRESENTS FILE IS USED WITH THE FILE POINTER NAME PTR.
PTR=FOPEN("SALARY.TXT","R"); IT WILL OPEN A FILE IN THE NAME OF SALARY IN READ MODE
![Page 20: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/20.jpg)
PROBLEMS WHILE WRITING THE CODE
• totalPerPerson = totalPerPerson +(amount * price[menuOption - 1] );
• -1 , only when -1 is given it will take array[0], other wise for item 1 it will take as[1].
• Float array prices are declared inside main(). So it is not able access by other functions outside the main
![Page 21: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/21.jpg)
EXPLANATION OF CODE
It is a c program in which we have taken the prices as well as the taxes on item in float and no. of person in integer type.
In the first part of the code we are creating the program i.e what we want to be in receipt and how would be proceed.
![Page 22: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/22.jpg)
In the second we created the program in such a way that it shows it will show us the menu card.
In the next half we made the so as to tell the prices after adding taxes and various discounts.
Further we made the program to check and the task as per the requirement and then give the result i.e the price.
![Page 23: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/23.jpg)
And in the last part we made the program to show the salary of various employees.
And for making this code we have various datatypes i.e. the pointers, functions, strings, integer type, float and many more.
![Page 24: cafeteria info management system](https://reader033.vdocuments.mx/reader033/viewer/2022061217/54b4e7224a7959212a8b4646/html5/thumbnails/24.jpg)
THANK YOU