-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhotelbook
359 lines (265 loc) · 12.4 KB
/
hotelbook
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
using System;
using System.Net.Http.Headers;
namespace HotelBookingProgram
{
class Program
{
static void Main(string[] args)
{
char retry;
do
{
Console.Clear();
Console.WriteLine("Welcome to Bigtas Hotel!");
string? name, age , address , contactNumber , emailAddress ;
int residents;
Console.Write("Please enter your name: ");
name = Console.ReadLine();
Console.Write("Please enter your age: ");
age = Console.ReadLine();
Console.Write("Please enter your address: ");
address = Console.ReadLine();
Console.Write("Please enter your contact number: ");
contactNumber = Console.ReadLine();
Console.Write("Please enter your email address: ");
emailAddress = Console.ReadLine();
Console.Write("How many residents will be staying: ");
residents = int.Parse(Console.ReadLine());
// ex
Console.Clear();
Console.WriteLine("These are our branches inside Laguna");
Console.WriteLine(" SR = Sta.Rosa \n BAE = Bae \n SC = Sta.Cruz \n SP = San Pablo \n LB = Los Banos ");
// EX
bool validBranch = false;
string branch;
do
{
Console.Write("To choose your designated branch, just enter it's code : ");
branch = Console.ReadLine().ToUpper();
switch (branch)
{
case "SR":
Console.WriteLine("You selected Sta. Rosa.");
validBranch = true ;
break;
case "BAE":
Console.WriteLine("You selected Bae.");
validBranch = true ;
break;
case "SC":
Console.WriteLine("You selected Sta. Cruz.");
validBranch = true ;
break;
case "SP":
Console.WriteLine("You selected San Pablo.");
validBranch = true ;
break;
case "LB":
Console.WriteLine("You selected Los Banos.");
validBranch = true ;
break;
default:
Console.WriteLine("Wrong code, please only enter the available code");
break;
}
}
while (!validBranch);
// ex
Console.Clear();
int SS = 500 , MS = 800 , BS = 1000 , HS = 1500 , PS = 2000 ;
Console.WriteLine("Here are our offers : \nSS1, SS2, SS3, SS4, SS5 \n Standard Suites (500 php per head for 24hrs)");
Console.WriteLine("It includes : \n A living area \n A bedroom with queen-sized bed \n A bathroom with a shower");
Console.ReadKey();
Console.Clear();
Console.WriteLine("MS1, MS2, MS3, MS4, MS5 \n Mini Suite (800 php per head for 24hrs)");
Console.WriteLine("Separate living area \n A bedroom with king-sized bed \n A spacious bathroom with a bathtub and shower \n Work desk \n High-speed internet \n Flat screen TV \n");
Console.ReadKey();
Console.Clear();
Console.WriteLine("BS1, BS2, BS3, BS4, BS5 \n Bridal Suites (1000 php per head for 24hrs)");
Console.WriteLine("Romantic ambiance with a king-sized bed \n A spacious bathroom with a Jacuzzi tub \n A separate living area \n Champagne \n Chocolates \n Other romantic touches");
Console.ReadKey();
Console.Clear();
Console.WriteLine("HS1, HS2, HS3, HS4, HS5 \n Honeymoon Suite (1500 php per head for 24hrs)");
Console.WriteLine("Four-poster bed \n A private balcony with a view \n A spacious bathroom with a Jacuzzi tub \n Bottle of champagne \n Rose petals \n Other romantic amenities \n ");
Console.ReadKey();
Console.Clear();
Console.WriteLine("PS1, PS2, PS3, PS4, PS5 \n Presidential Suite (2000 php per head for 24hrs)");
Console.WriteLine("A separate living area \n A dining area \n A bedroom with a king-sized bed \n A spacious bathroom with a Jacuzzi tub \n Private balcony with a view \n A fully equipped kitchen \n A butler service");
Console.ReadKey();
Console.Clear();
Console.WriteLine(" SS = Standard Suites \n MS = Mini Suite \n BS = Bridal Suites \n HS = Honeymoon Suite \n PS = Presidential Suite ");
bool validroom = false;
string? room;
int costperday = 0 ;
do
{
Console.Write("Enter the code of the room that you choose: ");
room = Console.ReadLine().ToUpper();
switch (room)
{
case "SS":
Console.WriteLine("You selected Standard Suite");
costperday = SS ;
validroom = true;
break;
case "MS":
Console.WriteLine("You selected Mini Suite.");
costperday = MS ;
validroom = true;
break;
case "BS":
Console.WriteLine("You selected Bridal Suites.");
costperday = BS ;
validroom = true;
break;
case "HS":
Console.WriteLine("You selected Honeymoon Suite.");
costperday = HS ;
validroom = true;
break;
case "PS":
Console.WriteLine("You selected Presidential Suite.");
costperday = PS ;
validroom = true;
break;
default:
Console.WriteLine("Wrong code, please only enter the available code");
break;
}
}
while (!validroom);
// mmsad
Console.Clear();
Console.Write($"The selected room {room} has 5 available rooms.");
int selectedRoom = 0;
bool isValidRoom = false;
while (!isValidRoom)
{
Console.WriteLine("Choose a room number from 1-5:");
string input = Console.ReadLine();
if (int.TryParse(input, out selectedRoom))
{
if (selectedRoom >= 1 && selectedRoom <= 5)
{
isValidRoom = true;
}
else
{
Console.Write("Invalid input. Please choose a room number from 1-5: ");
}
}
else
{
Console.Write("Invalid input. Please enter a numeric value: ");
}
}
Console.WriteLine($"You selected room {selectedRoom} of {room}.");
// asd
Console.Clear();
Console.WriteLine("How many days would you like to stay?");
int chosenDate = int.Parse(Console.ReadLine());
int total = residents * (chosenDate * costperday) ;
Console.WriteLine($"The total cost for {room} with {chosenDate} number of days and {residents} residents is : P" + total);
string paymentmeth = paymentMethod();
if (paymentmeth == "Card")
{
Cardpayment(total);
}
else if (paymentmeth == "Gcash"){
gcashpayment(total);
}
else if (paymentmeth == "Paypal"){
Paypalpayment(total);
}
// Display user inputs
Console.Clear();
Console.WriteLine("Your book to Bigtas Hotel is accepted! \nBooking Details :");
Console.WriteLine("Name: " + name);
Console.WriteLine("Laguna Branch: " + branch);
Console.WriteLine("Days to stay: " + chosenDate);
Console.WriteLine("Room Choice: " + room + selectedRoom);
Console.WriteLine("Residents: " + residents);
Console.WriteLine("Total Cost: " + total);
Console.WriteLine("Payment method: " + paymentmeth);
Console.Write("Do you want to book another room? (y/n): ");
retry = char.Parse(Console.ReadLine());
}while(retry == 'y');
if (retry != 'n');
{
showguidelines(); // binago koto
}
}
static string paymentMethod()
{
Console.Write("\n\n Select Payment Method: ");
Console.WriteLine("\n1. Card");
Console.WriteLine("2. Gcash");
Console.WriteLine("3. Paypal");
int choice = int.Parse(Console.ReadLine());
do
{
Console.Write("Enter the number of your payment method choice: ");
}
while (choice < 1 || choice > 3);
switch (choice)
{
case 1:
return "Card";
case 2:
return "Gcash";
case 3:
return "Paypal";
default:
return string.Empty;
}
}
static void Cardpayment(double total)
{
Console.WriteLine("Payment Details: ");
Console.Write("Enter your credit card number: ");
string creditcardnumber = Console.ReadLine();
Console.Write("Enter the expiration date YY/MM: ");
string expdate = Console.ReadLine();
Console.Write("Enter CVV: ");
string cvv = Console.ReadLine();
Console.WriteLine($"Credit Card successful! Total amount charged: ${total:F2}\n");
Console.ReadKey();
}
static void Paypalpayment(double total)
{
Console.WriteLine("Payment Details:");
Console.Write("Enter your PayPal email address: ");
string paypalEmail = Console.ReadLine();
Console.WriteLine($"PayPal Payment successful! Total amount charged: ${total:F2}\n");
Console.ReadKey();
}
static void gcashpayment(double total)
{
Console.WriteLine("Payment Details:");
Console.Write("Enter your name: ");
Console.Write("\nEnter your GCash mobile number: ");
string gcashNumber = Console.ReadLine();
Console.WriteLine($"GCash Payment successful! Total amount charged: ${total:F2}\n");
Console.ReadKey();
}
static void showguidelines()
{
// gaaaaaaaaaaaaaaaaa
Console.WriteLine("Thank you for booking a room with us!");
Console.WriteLine("Here are some guidelines to make your stay enjoyable:");
Console.WriteLine("- Check-in time is ating ang gabing itoooo");
Console.WriteLine("- Pets are not allowed in the rooms.");
Console.WriteLine("- Smoking is prohibited in all indoor areas.");
Console.WriteLine("- Room service is available 24/7.");
Console.WriteLine("- To call for Room service press the dedicated button on the telephone labeled Room Service");
Console.WriteLine("- In case of any emergency, dial 911.");
Console.WriteLine("\nThank you for choosing Bigtas Hotel, have a nice stay!\n");
}
// check in ,check out date
// child and adult rates
// room limits
// gagawing arrays
// guidelines
//
}
}