-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
180 lines (169 loc) · 6.52 KB
/
main.cpp
File metadata and controls
180 lines (169 loc) · 6.52 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
// Hotel_Management_System
// C++
// Switch-Case statement
// if-else statement
// goto statement
#include<iostream>
using namespace std;
int main()
{
int Num ;
int choice;
// Quantity initialize
int Nrooms = 0, Nvadapav = 0 ,Nnoodles = 0,Nmilkshake = 0,Nbiryani = 0,Ndesert= 0;
// Sold items initialize
int Srooms = 0, Svadapav = 0, Snoodles = 0, Smilkshake = 0, Sbiryani = 0, Sdesert = 0;
// Total price initialize
int T_rooms = 0, T_vadapav = 0, T_noodles = 0, T_milkshake = 0, T_biryani = 0, T_desert = 0;
// Preenter the having amount by user/Owner
cout << "\n\t\t\t!! QUANTITY OF ITEMS WE HAVE!! ";
cout << "\n AVAILABLE ROOMS: ";
cin >> Nrooms;
cout <<"\n QUANTITY OF VADAPAV: ";
cin >> Nvadapav;
cout <<"\n QUANTITY OF NOODLES: ";
cin >> Nnoodles;
cout <<"\n QUANTITY OF MILKSHAKE: ";
cin >> Nmilkshake;
cout <<"\n QUANTITY OF BIRYANI: ";
cin >> Nbiryani;
cout <<"\n QUANTITY OF DESSERT: ";
cin >> Ndesert;
m:
// menu choose by customer
cout << "\n\t\t\t!! PLEASE SELECT FROM THE GIVEN MENU !!";
cout <<"\n\n1) ROOMS ";
cout <<"\n2) VADAPAV";
cout <<"\n3) NOODLES";
cout <<"\n4) MILKSHAKE";
cout <<"\n5) BIRYANI";
cout <<"\n6) DESSERT";
cout <<"\n7) Information regarding SALES";
cout <<"\n8) Exit";
cout << " \n\n PLease Enter your choice no: ";
cin >> choice;
// Use switch-case statement to to made choice and alot items from present available items
switch (choice)
{
// Rooms
case 1:
cout << "\n\n\t Enter the number of rooms you want: ";
cin >> Num;
// if-else statement
if(Nrooms-Srooms >=Num)
{
Srooms = Srooms + Num;
T_rooms = T_rooms + Num * 1200;
cout << "\n\n\t\t" << Num << " Room/Rooms have been alloted to you!";
}
else
cout << "\n\tOnly " << Nrooms - Srooms << " Rooms remaining in hotel";
break;
// Vadapav
case 2:
cout << "\n\n Enter the Vadapav Quantity:";
cin >> Num;
if (Nvadapav - Svadapav >= Num)
{
Svadapav = Svadapav + Num;
T_vadapav = T_vadapav + Num * 20;
cout << "\n\n\t\t" << Num << " vadapav is the order!!";
}
else
cout << "\n\tOnly " << Nvadapav - Svadapav << " vadapav remaining in hotel";
break;
// noodles
case 3:
cout << "\n\n Enter the noodles Quantity: ";
cin >> Num;
if (Nnoodles - Snoodles >= Num)
{
Snoodles = Snoodles + Num;
T_noodles = T_noodles + Num * 100;
cout << "\n\n\t\t" << Num << " noodles is the order!!";
}
else
cout << "\n\tOnly " << Nnoodles - Snoodles << " noodles remaining in hotel";
break;
// Milkshake
case 4:
cout << "\n\n Enter the milkshake Quantity:";
cin >> Num;
if (Nmilkshake - Smilkshake >= Num)
{
Smilkshake = Smilkshake + Num;
T_milkshake = T_milkshake + Num * 50;
cout << "\n\n\t\t" << Num << " milkshake is the order!!";
}
else
cout << "\n\tOnly " << Nmilkshake - Smilkshake << " milkshake remaining in hotel";
break;
// Biryani
case 5:
cout << "\n\n Enter the biryani Quantity: ";
cin >> Num;
if (Nbiryani - Sbiryani >= Num)
{
Sbiryani = Sbiryani + Num;
T_biryani = T_biryani + Num * 200;
cout << "\n\n\t\t" << Num << " biryani is the order!!";
}
else
cout << "\n\tOnly " << Nbiryani - Sbiryani << " biryani remaining in hotel";
break;
// Dessert
case 6:
cout << "\n\n Enter the dessert Quantity: ";
cin >> Num;
if (Ndesert - Sdesert >= Num)
{
Sdesert = Sdesert + Num;
T_desert = T_desert + Num * 150;
cout << "\n\n\t\t" << Num << " dessert is the order!!";
}
else
cout << "\n\tOnly " << Ndesert- Sdesert << " dessert remaining in hotel";
break;
case 7:
// gives details of sales
cout << "\n\t\t\t !! DETAILS OS TODAYS SALES AND COLLECTIONS !!";
// rooms
cout<<"\n\n Number of rooms we had: "<<Nrooms;
cout<<"\n\n Number of rooms we gave for rent: "<<Srooms;
cout<<"\n\n Remaining rooms: "<<Nrooms - Srooms;
cout<<"\n\n Total rooms collection of the day: "<<T_rooms<<" Rs";
// vadapav
cout << "\n\n Number of vadapav we had: " << Nvadapav;
cout << "\n\n Number of vadapav we sold: " << Svadapav;
cout << "\n\n Remaining vadapav: " << Nvadapav - Svadapav;
cout << "\n\n Total vadapav collection of the day: " << T_vadapav<<" Rs";
// noodles
cout << "\n\n Number of noodles we had: " << Nnoodles;
cout << "\n\n Number of noodles we sold: " << Snoodles;
cout << "\n\n Remaining noodles: " << Nnoodles - Snoodles;
cout << "\n\n Total noodles collection of the day: " << T_noodles<<" Rs";
// milkshake
cout << "\n\n Number of milkshake we had: " << Nmilkshake;
cout << "\n\n Number of milkshake we sold: " << Smilkshake;
cout << "\n\n Remaining milkshake: " << Nmilkshake - Smilkshake;
cout << "\n\n Total milkshake collection of the day: " << T_milkshake<<" Rs";
// biryani
cout << "\n\n Number of biryani we had: " << Nbiryani;
cout << "\n\n Number of biryani we sold: " << Sbiryani;
cout << "\n\n Remaining biryani: " << Nbiryani - Sbiryani;
cout << "\n\n Total biryani collection of the day: " << T_biryani<<" Rs";
// dessert
cout << "\n\n Number of dessert we had: " << Ndesert;
cout << "\n\n Number of dessert we sold: " << Sdesert;
cout << "\n\n Remaining dessert: " << Ndesert - Sdesert;
cout << "\n\n Total dessert collection of the day: " << T_desert<<" Rs";
// Tptal collection of the day
cout << "\n\n\n TOTAL COLLECTION OF THE DAY IS : "<<T_biryani+T_desert+T_milkshake+T_rooms+T_vadapav+T_noodles<<" Rs";
case 8:
exit(0);
default:
cout << "\n\n Please select the numbers mentioned above!!";
break;
}
goto m;
}