Dim cabinName = New String() {"Hetty", "Poppy", "Blue Skies", "Bay View", "Happy Days", "Summer Joy", "Walkers' Rest", "Bertie", "Green Foreast Lodge", "Coppice Lodge"}
Dim peakRate = New Integer() {400, 400, 500, 650, 695, 800, 950, 1050, 1200, 1500}
Dim offpeakRate = New Integer() {250, 250, 350, 500, 550, 600, 750, 850, 950, 1150}
Dim capacity = New Integer() {4, 4, 4, 6, 6, 6, 8, 8, 10, 10}
Dim calendar(9, 16) As Double
Dim bookingRef As Integer = 201900
Dim cabinChoice As Integer
Console.WriteLine("This booking platform can only be used for the 2019 season, from week 23 to 39. Please select an appropriate cabin for yourself and/or your group.")
Console.WriteLine("Here are your options, please choose the number associated with the cabin of your choice:")
Console.WriteLine(i + 1 & "." & cabinName(i) & " capacity:" & capacity(i) & " peakrate: $" & peakRate(i) & " offpeakrate: $" & offpeakRate(i))
cabinChoice = Console.ReadLine()
If cabinChoice < 1 Or cabinChoice > 10 Then
Console.WriteLine("Please choose a valid unit number.")
ElseIf cabinChoice >= 1 Or cabinChoice <= 10 Then
cabinChoice = cabinChoice - 1
Console.WriteLine("You have selected " & cabinName(cabinChoice))
Console.WriteLine("Is this your final choice?")
response = Console.ReadLine()
Console.WriteLine("you will now move to the week section.")
Weeks(cabinName, peakRate, offpeakRate, capacity, cabinChoice, response, calendar, bookingRef)
Console.WriteLine("You will be directed to the booking section again.")
Sub Weeks(ByVal cabinName As Array, peakRate As Array, offpeakrate As Array, capacity As Array, cabinChoice As Integer, response As String, calendar As Array, bookingRef As Integer)
Console.WriteLine("Checkin and Checkout can only happen on Mondays and Sundays. Which is why this booking system books over a week and not days.")
Dim pplstaying As Integer
If calendar(cabinChoice, i) = 0 Then
Console.WriteLine(cabinName(cabinChoice) & " is available in week " & i + 23)
ElseIf calendar(cabinChoice, i) > 0 Then
Console.WriteLine(cabinName(cabinChoice) & " is available in week " & i + 23)
rejDate: Console.WriteLine("Which week would you like to checkin.")
startWeek = Console.ReadLine - 23
Console.WriteLine("Which week would you like to checkout.")
endWeek = Console.ReadLine - 23
Console.WriteLine("Are you sure about the weeks you have chosen.")
response = Console.ReadLine
Console.WriteLine("Ok, you will now move forward.")
Console.WriteLine("You will now go back to the start of the selection component of the code")
Console.WriteLine("Please enter the number of guests staying at the hotel room.")
pplstaying = Console.ReadLine
If pplstaying <= capacity(cabinChoice) Then
Console.WriteLine("You will now move on to the payments section.")
Payments(cabinName, peakRate, offpeakrate, capacity, cabinChoice, response, calendar, bookingRef)
ElseIf pplstaying > capacity(cabinChoice) Then
Console.WriteLine("The number of geusts is to to much for this cabin to hold, please pick another cabin.")
Sub Payments(ByVal cabinName As Array, peakRate As Array, offpeakrate As Array, capacity As Array, cabinChoice As Integer, response As String, calendar As Array, bookingRef As Integer)
bookingRef = bookingRef + 1
For i = startWeek To endWeek
calendar(cabinChoice, i) = bookingRef
If startWeek And endWeek < 3 Or startWeek And endWeek > 12 Then
total = (endWeek - startWeek) * offpeakrate(cabinChoice)
ElseIf startWeek < 3 And endWeek > 3 And endWeek < 13 Then
total = (endWeek - 3) * peakRate(cabinChoice) + 3 * peakRate(cabinChoice)
ElseIf startWeek > 3 And startWeek < 13 And endWeek >= 13 Then
total = (endWeek - 13) * peakRate(cabinChoice) + (10 - (startWeek - 3)) * offpeakrate(cabinChoice)
ElseIf startWeek And endWeek > 3 Or startWeek And endWeek < 13 Then
total = (endWeek - startWeek) * peakRate(cabinChoice)
If (endWeek - startWeek) >= 3 Then
Console.WriteLine("Your booking refrence is " & bookingRef)
Console.WriteLine("The total cost is $" & total)
Console.WriteLine("Would you like to go back to the cabin choices again?")
response = Console.ReadLine()
Console.WriteLine("This program will now end.")
Console.WriteLine("You will now go back to the start of the selection component of the code..")