-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCANTEEN.C
118 lines (117 loc) · 2.23 KB
/
CANTEEN.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
int i,j,opt=0,num=0,cost=0,sp=0,profit=0,tot=0,again=0;
char date[50];
gets(date);
clrscr();
for(j=0; ;j++)
{
for(i=0; ;i++)
{
printf("Enter \n 1: for coffee \n 2: for tea \n 3: for water \n 4: ColdDrink ");
printf("\n 5: for cold coffee \n 6: for Patties \n 7: for burger \n 8: for Momo \n");
printf(" 9:To print Bill \n");
scanf("%d",&opt);
if(opt==1)
{
printf("How many coffee \n");
scanf("%d",&num);
cost=8;
sp=15;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==2)
{
printf("How many Tea \n");
scanf("%d",&num);
cost=8;
sp=15;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==3)
{
printf("How many water \n");
scanf("%d",&num);
cost=12;
sp=20;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==4)
{
printf("How many ColdDrink \n");
scanf("%d",&num);
cost=8;
sp=15;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==5)
{
printf("How many ColdCoffee \n");
scanf("%d",&num);
cost=15;
sp=25;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==6)
{
printf("How many Patties \n");
scanf("%d",&num);
cost=8;
sp=15;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==7)
{
printf("How many Burger \n");
scanf("%d",&num);
cost=15;
sp=25;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==8)
{
printf("How many Momo \n");
scanf("%d",&num);
cost=25;
sp=35;
profit+=(sp*num)-(cost*num);
tot+=(sp*num);
printf("net amount is %d \n",(sp*num));
}
if(opt==9)
{
printf("Total Amount is %d \n",tot);
break;
}
}
printf("Next Coustumer press 1 \n");
scanf("%d",&again);
tot=0;
if(again!=1)
{
fp=fopen("Profit_Canteen.txt","a+");
fprintf(fp,"%d \n",profit);
fclose(fp);
printf("Profit Till Now %d",profit);
break;
}
}
getch();
}