Private cabins() As String = {"Hetty", "Poppy", "Blue Skies", "Bay View", "Happy Days", "Summer Joy", "Walkers' Rest", "Bertie", "Green Forest Lodge", "Coppice Lodge"}
Private capacity() As Integer = {4, 4, 4, 6, 6, 6, 8, 8, 10, 10}
Private peak() As Integer = {400, 400, 500, 650, 695, 800, 950, 1050, 1200, 1500}
Private offpeak() As Integer = {250, 250, 350, 500, 550, 600, 750, 850, 950, 1150}
Private cabinWeeks(169) As String
Private berror As Boolean
Private starting As Integer
Private nweeks As Integer
Private errormessage As String = "Your input is invalid."
Private housenumber As Integer
Private Bookingcode As String
Private peakcounter As Integer
Private offcounter As Integer
Private overbookcount As Integer
Private discountedPrice As Decimal
cabinWeeks(i) = "Not Booked"
Console.WriteLine("Free Weeks:")
If cabinWeeks(j + i * 17) = "Not Booked" Then
Console.WriteLine("{0} has a capacity of {1}. The peak and off peak prices are $ {2} and $ {3} respectively.", cabins(i), capacity(i), peak(i), offpeak(i))
Console.WriteLine("Which cabin would you like to book? Please make sure the first letters are in CAPS as displayed above.")
sInput = Console.ReadLine()
If cabins(i) = sInput Then
Console.WriteLine(errormessage)
Loop Until housenumber <> 10
Console.WriteLine("How many weeks would you like to book for?")
nweeks = Console.ReadLine()
If nweeks > 17 Or nweeks <= 0 Or berror = True Then
Console.WriteLine(errormessage)
Loop Until berror = False
Console.WriteLine("When is the starting week?")
starting = Console.ReadLine()
If starting + nweeks > 40 Or starting < 23 Then
For i = starting - 23 To starting + nweeks - 24
If cabinWeeks(housenumber * 17 + i) <> "Not Booked" Then
If berror = True Or overbookcount > 0 Then
Console.WriteLine(errormessage)
Loop Until berror = False And overbookcount = 0
Bookingcode = "#" & housenumber & starting & nweeks
For i = starting - 23 To starting + nweeks - 24
cabinWeeks(housenumber * 17 + i) = Bookingcode
For i = starting - 23 To starting + nweeks - 24
Price = peakcounter * peak(housenumber) + offcounter * offpeak(housenumber)
Console.WriteLine("Your booking code is {0}.", Bookingcode)
discountedPrice = Price * 0.9
Console.WriteLine("Because you booked 3 weeks or more, your 10 percent discounted price is $ {0}. Your original price was $ {1}.", discountedPrice, Price)
Console.WriteLine("Your booking cost is $ {0}.", Price)
Console.WriteLine("Please press ENTER if you would like to do another booking.")