-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHM.CPP
235 lines (234 loc) · 5.01 KB
/
HM.CPP
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#include<stdio.h>
#include<conio.h>
void orderfulldelete()
{
clrscr();
printf("YOU HAVE NOTHING TO ORDER\n");
printf("--------THANK YOU--------\n");
getch();
}
void orderpurchase(int pbur,int ppiz,int psan)
{
clrscr();
int kd,tbur,tsan,tpiz,kp,cn,jk;
float kk,cpay,vpay,vpay1,spay,spay1,tpay,fpay;
printf("<-------PURCHASE SLIP------->\n");
printf("\n\n");
printf("PRODUCT------->PRICE------->QUANTITY\n");
if(pbur>0)
printf("BURGER------>50----->%d\n",pbur);
if(ppiz>0)
printf("PIZZA------->80----->%d\n",ppiz);
if(psan>0)
printf("SANDWICH---->25----->%d\n",psan);
tbur=50*pbur;
tpiz=80*ppiz;
tsan=25*psan;
kd=tbur+tpiz+tsan;
kp=pbur+ppiz+psan;
printf("--------------------------\n");
printf("TOTAL PRODUCT %d",kp," PRICE %d",kd);
printf("\n\n");
printf("DO YOU WANT TO PAY IT BY: \n");
printf("1.CARD<-------------->2.CASH\n");
printf("press 1 or 2 to select\n");
scanf("%d",&cn);
if(cn==1)
{
clrscr();
jk=kd*2;
kk=jk/100.0f;
cpay=kk+kd;
printf("YOUR NET BILL IS= %d/-\n",kd);
printf("DUE TO CARD PAY YOUR BILL IS= %f/-\n",cpay);
vpay=cpay*4;
vpay1=vpay/100;
printf("VAT ON YOUR BILL= %f/-\n",vpay1);
spay=cpay*5;
spay1=spay/100;
printf("SERVICE CHARGE ON YOUR BILL= %f/-\n",spay1);
printf("------------------------------------------\n");
tpay=spay1+vpay1+cpay;
printf("YOUR TOTAL BILL IS=------------> %f/-\n",tpay);
getch();
}
if(cn==2)
{
clrscr();
fpay=kd*1.0f;
vpay=fpay*4;
vpay1=vpay/100;
spay=fpay*5;
spay1=spay/100;
tpay=fpay+vpay1+spay1;
printf("YOUR NET BILL IS= %d/-\n",kd);
printf("VAT ON YOUR BILL IS= %f/-\n",vpay1);
printf("SERVICE CHARGE ON YOUR BILL IS= %f/-\n",spay1);
printf("-------------------------------------\n");
printf("YOUR TOTAL BILL IS= %f/-",tpay);
getch();
}
}
void orderdelete(int de,int ef,int fd)
{
clrscr();
int dbur,dpiz,dsan,it,tk;
for(it=0;it<=1;it++)
{
clrscr();
printf("----WHAT YOU WANT TO DELETE----\n");
if(de>0)
{
printf("just intialize 0 to delete BURGER or press 1 to skip\n=");
scanf("%d",&dbur);
}
if(ef>0)
{
printf("just intialize 0 to delete PIZZA or press 1 to skip\n=");
scanf("%d",&dpiz);
}
if(fd>0)
{
printf("just intialize 0 to delete SANDWICH or press 1 to skip\n=");
scanf("%d",&dsan);
}
if(dbur==0)
{
de=0;
}
if(dpiz==0)
{
ef=0;
}
if(dsan==0)
{
fd=0;
}
printf("-----HERE IS YOUR ORDER------\n");
printf("\n\n");
printf("PRODUCT------->QUANTITY\n");
if(dbur>0)
printf("BURGER------->%d\n",de);
if(dpiz>0)
printf("PIZZA------->%d\n",ef);
if(dsan>0)
printf("SANDWICH---->%d\n",fd);
printf("\n\n");
printf("press 1 to delete a item\n");
printf("press 2 to delete all of item\n");
printf("press 3 to purchase item\n");
scanf("%d",&tk);
if(tk==1)
{
it=it-2;
continue;
}
if(tk==2)
orderfulldelete();
if(tk==3)
orderpurchase(dbur,dpiz,dsan);
}
}
void orderedit(int ab,int bc,int ca)
{
clrscr();
int bur,piz,san,i,temp;
for(i=0;i<=1;i++)
{
clrscr();
printf("previous order BURGER=%d\n",ab);
printf("new order BURGER=");
scanf("%d",&bur);
printf("previous order PIZZA=%d\n",bc);
printf("new order PIZZA=");
scanf("%d",&piz);
printf("previous order SANDWICH=%d\n",ca);
printf("new order SANDWICH=");
scanf("%d",&san);
clrscr();
printf("-----HERE IS YOUR ORDER-----\n");
printf("\n\n");
printf("PRODUCT<------->QUANTITY\n");
if(bur>0)
printf("BURGER<------->%d\n",bur);
if(piz>0)
printf("PIZZA<------->%d\n",piz);
if(san>0)
printf("SANDWICH<---->%d\n",san);
printf("\n\n");
printf("press 1 to edit item\n");
printf("press 2 to delete a particular item\n");
printf("press 3 to delete all of the item\n");
printf("press 4 to purchase the item\n");
scanf("%d",&temp);
if(temp==1)
{
i=i-2;
continue;
}
if(temp==2)
{
orderdelete(bur,piz,san);
}
if(temp==3)
orderfulldelete();
if(temp==4)
orderpurchase(bur,piz,san);
}
}
void ordershow(int a,int b,int c)
{
clrscr();
int d;
printf("------HERE IS YOU ORDER------\n");
printf("\n\n");
printf("PRODUCT<------->QUANTITY\n");
if(a>0)
printf("BURGER<------->%d\n",a);
if(b>0)
printf("PIZZA<------->%d\n",b);
if(c>0)
printf("SANDWICH<------>%d\n",c);
printf("\n\n");
printf("press 1 to edit your item\n");
printf("press 2 to delete a particular item\n");
printf("press 3 to delete all of the item\n");
printf("press 4 to purchase the item\n");
scanf("%d",&d);
if(d==1)
{
orderedit(a,b,c);
}
if(d==2)
{
orderdelete(a,b,c);
}
if(d==3)
orderfulldelete();
if(d==4)
orderpurchase(a,b,c);
}
void order()
{
int j,g,h,xj,xg,xh;
printf("----GIVE YOUR ORDER----\n");
printf("give the quatity of the items below if you don't want a particular item so just press 0 there\n");
printf("BURGER=");
scanf("%d",&j);
printf("PIZZA=");
scanf("%d",&g);
printf("SANDWICH=");
scanf("%d",&h);
ordershow(j,g,h);
}
int main()
{
clrscr();
printf("HOTEL MANEGMENT\n");
printf("1.BURGER--------->50/-\n");
printf("2.PIZZA--------->80/-\n");
printf("3.SANDWICH--------->25/-\n");
printf("\n\n");
order();
return 0;
}