-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathay.cpp
More file actions
344 lines (341 loc) · 15 KB
/
ay.cpp
File metadata and controls
344 lines (341 loc) · 15 KB
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#include <iostream>
using namespace std;
int option, x, y, z, w, op;
void header();
int menu();
int sm();
int cm();
void things();
main()
{
option = 0;
while (option != 3)
{
header();
option = menu();
if (option == 1)
{
op = sm();
if (op < 8)
{
if (op == 1)
{
things();
}
if (op == 2)
{
cout << "enter price of cake" << endl;
cin >> x;
cout << "price of cake is:" << x << endl;
cout << "enter price of lays" << endl;
cin >> y;
cout << "price of lays is:" << y << endl;
cout << "enter price of pizza" << endl;
cin >> z;
cout << "price of pizza is:" << z << endl;
cout << "enter price of burger" << endl;
cin >> w;
cout << "price of burger is:" << w << endl;
}
if (op == 3)
{
int costprice, saleprice, number;
float cakeprofit, laysprofit, pizzaprofit, burgerprofit, totalprofit;
string item;
cout << "enter item" << endl;
cin >> item;
if (item == "cake")
{
cout << "enter cake cost price" << endl;
cin >> costprice;
cout << "enter cake sale price" << endl;
cin >> saleprice;
cakeprofit = saleprice - costprice;
cout << "enter number of cakes" << endl;
cin >> number;
totalprofit = cakeprofit * number;
cout << "total profit on cakes is:" << totalprofit << endl;
}
if (item == "lays")
{
cout << "enter cake cost price" << endl;
cin >> costprice;
cout << "enter cake sale price" << endl;
cin >> saleprice;
laysprofit = saleprice - costprice;
cout << "enter number of lays" << endl;
cin >> number;
totalprofit = laysprofit * number;
cout << "total profit on lays is" << totalprofit << endl;
}
if (item == "pizza")
{
cout << "enter pizza cost price" << endl;
cin >> costprice;
cout << "enter pizza sale price" << endl;
cin >> saleprice;
pizzaprofit = saleprice - costprice;
cout << "enter number of pizza" << endl;
cin >> number;
totalprofit = pizzaprofit * number;
cout << "total profit on pizza is" << totalprofit << endl;
}
if (item == "burger")
{
cout << "enter burger cost price" << endl;
cin >> costprice;
cout << "enter burger sale price" << endl;
cin >> saleprice;
burgerprofit = saleprice - costprice;
cout << "enter number of burger" << endl;
cin >> number;
totalprofit = burgerprofit * number;
cout << "total profit on burger is" << totalprofit << endl;
}
}
if (op == 4)
{
int costprice, saleprice, number;
float cakeloss, laysloss, pizzaloss, burgerloss, totalloss;
string item;
cout << "enter item" << endl;
cin >> item;
if (item == "cake")
{
cout << "enter cake cost price" << endl;
cin >> costprice;
cout << "enter cake sale price" << endl;
cin >> saleprice;
cakeloss = saleprice - costprice;
cout << "enter number of cakes" << endl;
cin >> number;
totalloss = cakeloss * number;
cout << "total loss on cakes is:" << totalloss;
}
if (item == "lays")
{
cout << "enter cake cost price" << endl;
cin >> costprice;
cout << "enter cake sale price" << endl;
cin >> saleprice;
laysloss = saleprice - costprice;
cout << "enter number of lays" << endl;
cin >> number;
totalloss = laysloss * number;
cout << "total loss on lays is" << totalloss;
}
if (item == "pizza")
{
cout << "enter pizza cost price" << endl;
cin >> costprice;
cout << "enter pizza sale price" << endl;
cin >> saleprice;
pizzaloss = saleprice - costprice;
cout << "enter number of pizza" << endl;
cin >> number;
totalloss = pizzaloss * number;
cout << "total loss on pizza is" << totalloss;
}
if (item == "burger")
{
cout << "enter burger cost price" << endl;
cin >> costprice;
cout << "enter burger sale price" << endl;
cin >> saleprice;
burgerloss = saleprice - costprice;
cout << "enter number of burger" << endl;
cin >> number;
totalloss = burgerloss * number;
cout << "total loss on burger is" << totalloss;
}
}
if (op == 5)
{
int totalcakesleft, totallaysleft, totalpizzaleft, totalburgerleft, totalnumberofpizza, totalnumberofcakes, totalnumberoflays, totalnumberofburger, pizzasold, burgersold, cakessold, layssold;
string item;
cout << "enter item" << endl;
cin >> item;
if (item == "cake")
{
cout << "enter total number of cakes" << endl;
cin >> totalnumberofcakes;
cout << "enter total number of cakes sold" << endl;
cin >> cakessold;
totalcakesleft = totalnumberofcakes - cakessold;
cout << "cakes stock is:" << totalcakesleft;
}
if (item == "lays")
{
cout << "enter total number of lays" << endl;
cin >> totalnumberoflays;
cout << "enter total number of lays sold" << endl;
cin >> layssold;
totallaysleft = totalnumberoflays - layssold;
cout << "lays stock is:" << totallaysleft;
}
if (item == "pizza")
{
cout << "enter total number of pizza" << endl;
cin >> totalnumberofpizza;
cout << "enter total number of pizza sold" << endl;
cin >> pizzasold;
totalpizzaleft = totalnumberofpizza - pizzasold;
cout << "pizza stock is:" << totalpizzaleft;
}
if (item == "burger")
{
cout << "enter total number of burger" << endl;
cin >> totalnumberofburger;
cout << "enter total number of burger sold" << endl;
cin >> burgersold;
totalburgerleft = totalnumberofburger - burgersold;
cout << "burger stock is:" << totalburgerleft;
}
}
if (op == 6)
{
string item;
int updatepriceofcake, updatepriceofburger, updatepriceoflays, updatepriceofpizza, pizzaadd, burgeradd, cakeadd, laysadd, previouspriceofcake, previouspriceofburger, previouspriceoflays, previouspriceofpizza;
cout << "enter item" << endl;
cin >> item;
if (item == "cake")
{
cout << "enter previous price of cake" << endl;
cin >> previouspriceofcake;
cout << "enter additional price of cake" << endl;
cin >> cakeadd;
updatepriceofcake = previouspriceofcake + cakeadd;
cout << "update price of cake is" << updatepriceofcake;
}
if (item == "lays")
{
cout << "enter previous price of lays" << endl;
cin >> previouspriceoflays;
cout << "enter additional price of lays" << endl;
cin >> laysadd;
updatepriceoflays = previouspriceoflays + laysadd;
cout << "update price of lays is" << updatepriceoflays;
}
if (item == "pizza")
{
cout << "enter previous price of pizza" << endl;
cin >> previouspriceofpizza;
cout << "enter additional price of pizza" << endl;
cin >> pizzaadd;
updatepriceofpizza = previouspriceofpizza + pizzaadd;
cout << "update price of pizza is" << updatepriceofpizza;
}
if (item == "burger")
{
cout << "enter previous price of burger" << endl;
cin >> previouspriceofburger;
cout << "enter additional price of burger" << endl;
cin >> burgeradd;
updatepriceofburger = previouspriceofburger + burgeradd;
cout << "update price of burger is" << updatepriceofburger;
}
}
// tp= total price and disc is discounted price....
if (op == 7)
{
float disc, tp;
int cakeprice, pizzaprice, laysprice, burgerprice;
float num;
string item;
cout << "enter item" << endl;
cin >> item;
if (item == "cake")
{
cout << "enter discount you want to give";
cin >> num;
cout << "enter cake price: ";
cin >> x;
disc = x * num / 100.0;
tp = x - disc;
cout << "so discount on cake is:" << tp;
}
if (item == "lays")
{
cout << "enter discount you want to give" << endl;
cin >> num;
cout << "enter lays price: ";
cin >> x;
disc = x * num / 100.0;
tp = x - disc;
cout << "so discount on lays is:" << tp;
}
if (item == "pizza")
{
cout << "enter discount you want to give" << endl;
cin >> num;
cout << "enter pizza price: ";
cin >> x;
disc = x * num / 100.0;
tp = x - disc;
cout << "so discount on pizza is:" << tp;
}
if (item == "burger")
{
cout << "enter discount you want to give" << endl;
cin >> num;
cout << "enter burger price: ";
cin >> x;
disc = x * num / 100.0;
tp = x - disc;
cout << "so discount on burger is:" << tp;
}
}
}
}
}
}
void header()
{
cout << " ***************************************************************" << endl;
cout << " ********************SHOP MANAGEMENT SYSTEM*********************" << endl;
cout << " ***************************************************************" << endl;
}
int menu()
{
cout << "main menu>" << endl;
cout << "---------------------------------" << endl;
cout << "1-shopkeeper" << endl;
cout << "2-customer" << endl;
cout << "3-exit" << endl;
cout << "enter your option: " << endl;
cin >> option;
}
int sm()
{
cout << "main menu>shopkeeper module" << endl;
cout << "------------------------------" << endl;
cout << "1-things for sale" << endl;
cout << "2-price of all things" << endl;
cout << "3-profit on different things" << endl;
cout << "4-loss on different things" << endl;
cout << "5-check stock of all things" << endl;
cout << "6-update price of different thinns" << endl;
cout << "7-give discount on different things" << endl;
cout << "8-exit" << endl;
cout << "choose option.............." << endl;
cin >> op;
}
int cm()
{
cout << "main menu>customer module" << endl;
cout << "1-see things for purchase" << endl;
cout << "2-see price of things" << endl;
cout << "3-purchase things" << endl;
cout << "4-return things in case of any default" << endl;
cout << "5-pay bill" << endl;
cout << "6-exit" << endl;
cout << "enter any option:" << endl;
cin >> op;
}
void things()
{
cout << "1-cake" << endl;
cout << "2-lays" << endl;
cout << "3-pizza" << endl;
cout << "4-burger" << endl;
}