cafeteria info management system
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,459
On Slideshare
1,459
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
23
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CAFETERIA INFO MANAGEMENT SYSTEM 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
  • 2. CAFETERIA INFO MANAGEMENT SYSTEMIt is database to maintain the records of all itemssuch as the no. of items, its price, its quantity andother details related to those items. In CIMS wealso maintain the record of employees and otherdetail related to them.
  • 3. USE OF CIMSIt helps us to maintain the record of everythingpresent in cafeteria, and also to maintainrecords easily without being messed up andthus reduce the time consumption.
  • 4. LIST OF VARIABLES In cafeteria info management system, we make use of the following variables:1. TYPE OF THE MEAL (sandwiches/patties/beverages): int type2. NAME OF THE MEAL: character type3. QUANTITY OF THE MEAL: int type4. COST OF THE MEAL: int type5. TAX ON THE MEAL: int type6. CATEGORY OF THE EMPLOYEES (manager/subordinates/guard): character type7. NUMBER OF PEOPLE IN EACH CATEGORY: int type8. SALARY OF THE EMPLOYEES: int type.
  • 5. SOFTWARE USED:Operating system : Microsoft XP/Windows 7 Platform : C Language( 32 bits) Application Software : MS Office 2007/11
  • 6. 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 standardheader file.conio.h is Turbo C++ header file from Borland.. Its a non standard headerfile..used for clrscr(), getch() functions..
  • 7. 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)
  • 8. { 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();}
  • 9. ‘|| ‘ represent OR operator ,will be executed even if any one of the condition willbe truevoid printMeals();void orderMeals();the above both represents function definition.while(response == y) WHILE STATEMENTis used to execute the set of statement repeatedly till the condition is specifiedremains true.
  • 10. VOID PRINTMEALS(){ PRINTF("******** WELCOME TO CSE RESTURANT *******N"); PRINTF(" TTT BELOW IS THE MENUTTT"); PRINTF(" TTTTT MEALSTTTPRICE:N"); PRINTF(" TTT 1- VEG BURGERTTRS.25N"); PRINTF(" TTT 2-CHICK.BURGERTTRS.50N"); PRINTF(" TTT 3- VEG PATTIESTTRS.20N"); PRINTF(" TTT 4- CHICK.PATTIESTRS.50N"); PRINTF(" TTT 5- SANDWICHTTRS.40N"); PRINTF(" TTT 6- PEPSITTRS.60N"); PRINTF(" TTT 7- FANTAT TRS.40N"); PRINTF("N");}
  • 11. When the function void printMeals() is called it will diplay the above menu list.void orderMeals(){float totalPrice; float Payment,discount; printf(" ttORDER MENUn"); totalPrice = order(); Payment = totalPrice ; printf(" tt ** final BILL ** n"); printf(" tttpersontt%dtt%5.2fn",persons,totalPrice); printf(" tttTotal billttt%5.2fn",Payment );
  • 12. 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(" tttTotal bill after discountt%5.2fn",discount);}In the nested if else, the discount will be given based on the given conditions.
  • 13. 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 ordersn",i+1); while(response == y)
  • 14. { 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);
  • 15. } 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)
  • 16. OUTPUT
  • 17. { 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
  • 18. 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
  • 19. EXPLANATION OF CODEIt is a c program in which we have taken the pricesas well as the taxes on item in float and no. ofperson in integer type.In the first part of the code we are creating theprogram i.e what we want to be in receipt and howwould be proceed.
  • 20. In the second we created the program in such a way that itshows it will show us the menu card.In the next half we made the so as to tell the prices afteradding taxes and various discounts.Further we made the program to check and the task asper the requirement and then give the result i.e the price.
  • 21. And in the last part we made the program to showthe salary of various employees.And for making this code we have variousdatatypes i.e. thepointers, functions, strings, integer type, float andmany more.
  • 22. THANK YOU