Dim maxparking() As Integer = {8, 2, 2, 2, 2, 2, 4}
Dim hourprice() As Integer = {2, 10, 10, 10, 10, 10, 3}
Dim parkingday As Integer
Dim arrivaltime, parkinghours, parkingprice, frequentparknum As Integer
Dim discount, totalpayable As Double
Dim checkdigit, digit1, digit2, digit3, digit4, digit5 As Integer
Dim dailytotal As Integer = 0
Console.WriteLine("Welcome to Parking System")
Console.WriteLine("sunday=0, Monday =1, Tuesday=2, Wednesday=3, Thursday =4,
Console.WriteLine("INPUT DAY NUMBER")
parkingday = Console.ReadLine()
Loop Until parkingday >= 0 And parkingday <= 6
Console.WriteLine("Allowed time is 8:00 TO 24:00, No Parking from 24 TO 7")
arrivaltime = Console.ReadLine()
Loop Until arrivaltime >= 8 And arrivaltime <= 24
Console.WriteLine("Sunday Max: 8 hours, Saturday Max 4 Hours, Weekdays Max 2hours")
Console.WriteLine("input Parking hours")
parkinghours = Console.ReadLine()
Loop Until parkinghours >= 0 And parkinghours <= maxparking(parkingday)
If arrivaltime <= 15 Then
parkingprice = parkinghours * hourprice(parkingday)
ElseIf arrivaltime >= 16 Then
Console.WriteLine("Do you have frequent parking number? True for yes, False for No")
choice = Console.ReadLine()
Console.WriteLine("Enter your 5 digit frequent Parking number, one digit at a time")
digit1 = Console.ReadLine()
Console.WriteLine("digit 2= ?")
digit2 = Console.ReadLine()
Console.WriteLine("digit 3= ?")
digit3 = Console.ReadLine()
Console.WriteLine("digit 4= ?")
digit4 = Console.ReadLine()
Console.WriteLine("last digit checkDigit= ?")
digit5 = Console.ReadLine()
frequentparknum = (5 * digit1) + (4 * digit2) + (3 * digit3) + (2 * digit4)
checkdigit = 11 - (frequentparknum Mod 11)
If checkdigit = digit5 Then
If arrivaltime >= 16 Then
discount = parkingprice / 2
discount = (parkingprice / 100) * 10
Console.WriteLine("check digit did not verify")
totalpayable = parkingprice - discount
Console.WriteLine("Parking day selected is : " & parkingday)
Console.WriteLine("Arrival time in Parking : " & arrivaltime)
Console.WriteLine("total number of hours to leave car in parking : " & parkinghours)
Console.WriteLine(" Total Price of Parking is: = " & parkingprice)
Console.WriteLine("frequent parking num = " & digit1 & digit2 & digit3 & digit4 & digit5)
Console.WriteLine("Checkdigit: " & checkdigit)
Console.WriteLine("Discount : " & discount)
Console.WriteLine("Total amount to be paid = " & totalpayable)
Dim parkingclosed As Boolean
Dim customeramount As Integer
Console.WriteLine("Please Enter the amount you want to pay")
customeramount = Console.ReadLine()
While customeramount < totalpayable
Console.WriteLine("Amount you paid is less than parking fee, Enter again")
customeramount = Console.ReadLine()
dailytotal = dailytotal + customeramount
Console.WriteLine("Total Sale till now is : " & dailytotal)
Console.WriteLine("PARKING CLOSED ? TRUE for Yes, FALSE to Input Next Custoner)
parkingclosed = Console.ReadLine()
If parkingclosed = False Then
Loop Until parkingclosed = True
Console.WriteLine("Total Complete Day Amount = " & dailytotal)
Dim departuretime, departure, newprice As Integer
Dim pricebefore16, priceafter16 As Integer
Console.WriteLine("please Enter your departure time")
departuretime = Console.ReadLine()
departure = arrivaltime + parkinghours
If departuretime <= 16 Then
pricebefore16 = parkinghours * hourprice(parkingday)
pricebefore16 = (16 - arrivaltime) * hourprice(parkingday)
newprice = pricebefore16 + priceafter16
Console.WriteLine("fair Payment: " & newprice)