Imports Microsoft.VisualBasic
dim FirstNames(99) as string
dim Surnames(99) as string
dim VolunteerChoices(99) as integer
dim JoiningDates(99) as date
dim FeePaid(99) as boolean
dim VolunteerTypes = { "Not a volunteer",
"Painting and decorating"}
Dim MembersToAdd as Boolean
Dim ValidEntry as Boolean
Do While MembersToAdd And count < 100
Console.WriteLine("Please enter the first name of the new member: ")
response = Console.ReadLine()
Console.WriteLine("Invalid entry - you must enter a value")
response = Console.ReadLine()
FirstNames(Count) = response
Console.WriteLine("Please enter the surname of the new member: ")
response = Console.ReadLine()
Console.WriteLine("Invalid entry - you must enter a value")
response = Console.ReadLine()
Surnames(Count) = response
Console.WriteLine("Please enter the member's volunteering opition: ")
Console.WriteLine("Enter " & n &" for " & VolunteerTypes(n))
response = Console.ReadLine()
If Not isNumeric(response) Then
Console.WriteLine("Invalid entry - you must enter a number")
response = Console.ReadLine()
else if cint(response) < 0 OR cint(response) > 3
Console.WriteLine("Invalid enter - you must enter a number in the range of 0 to 3")
response = console.ReadLine()
Console.WriteLine("Please enter the start date in the format 'DD/MMM/YYYY' (e.g. 05/DEC/2020)")
response = console.ReadLine()
if not response.Length = 11 then
Console.WriteLine("The date entered is not the right length. Correctly formatted dates will have 11 characters")
response = Console.ReadLine()
else if not (response.Substring(2,1) = "/" and response.Substring(6,1) = "/") then
Console.WriteLine("The date entered is not the right format. The 3rd and 7th character should be '/'")
response = Console.ReadLine()
else if not isDate(response) then
Console.WriteLine("The data entered is not a valid date")
response = Console.ReadLine()
else if cdate(response) > today then
Console.WriteLine("This date is invalid - it is in the future")
response = Console.ReadLine()
else if cdate(response) < dateadd("yyyy", -4, Today) then
Console.WriteLine("The date entered is too far in the past. All dates should be in the last four years.")
response = Console.ReadLine()
Console.WriteLine("Has the member paid their fee?")
response = console.Readline()
Do While not(response = "y" or response = "n")
Console.WriteLine("Invalid Entry - please enter only 'y' or 'n'")
response = console.Readline
Console.WriteLine("Do you want another member? y/n?")
response = console.Readline()
Do While not(response = "y" or response = "n")
Console.WriteLine("Invalid Entry - please enter only 'y' or 'n'")
response = console.Readline
Dim FirstNames = {"Loukianos", "Ra", "Jevgēņija", "Jaidev", "Larisa", "Isaac", "Zinoviy", "Iuvenalis", "Fatih", "Cuthbert", "Phineas", "Teresa", "Alisher",
"Chyna", "Fulbert", "Glukel", "Lamech", "Naheed", "Ireneus", "Susana", "Mahavir", "Deepak", "Deodatus", "Hideaki", "Anass", "Arevik",
"Borbála", "Kefilwe", "Mary", "Celio"}
Dim Surnames = {"Erkens", "Fabian", "Lyndon", "D'Ambrosio", "Dimov", "Smith", "Jones", "Farrell", "Hughes", "Lowe", "Bureš", "Aerssens", "Svenson", "Graves",
"Janson", "Godfrey", "Marín", "Filipović", "Furnadjiev", "Tracy", "Bennet", "Abramsen", "Pichler", "Ljunggren", "Berg", "Amador", "Mata",
"Anderson", "Poirot", "Gáspár"}
Dim VolunteerChoices = {0, 2, 3, 3, 2, 3, 2, 0, 2, 2, 1, 3, 2, 3, 1, 2, 1, 2, 3, 1, 1, 0, 0, 1, 2, 3, 2, 3, 2, 2}
dim DateStrings = {"20/Jan/2022", "11/May/2021", "07/Jan/2020", "14/Apr/2020", "04/Aug/2020", "12/Mar/2021", "02/Dec/2021", "01/Dec/2021", "12/Apr/2021",
"28/Dec/2020", "05/Feb/2021", "28/Mar/2021", "20/Nov/2020", "03/Apr/2020", "24/Jan/2020", "21/Jan/2022", "15/Oct/2020", "03/Feb/2021",
"25/Nov/2020", "15/Oct/2021", "07/Mar/2021", "26/Apr/2020", "02/May/2021", "17/Jan/2022", "10/Apr/2021", "27/Jun/2021", "10/Sep/2020",
"31/Jan/2021", "25/Mar/2021", "08/Feb/2021"}
Dim JoiningDates(99) as date
for n = 0 to DateStrings.Length -1
JoiningDates(n) = cdate(DateStrings(n))
Dim FeePaid = {True, True, True, True, False, False, True, True, False, False, True, False, True, True, False, True, False,
True, False, False, False, False, False, True, True, False, True, False, False, True}
Dim VolunteerTypes = { "Not a volunteer",
"Painting and decorating"}
Dim ContinueToLoop as Boolean
Dim ValidEntry as boolean
Dim Arrayindex as integer
Console.WriteLine("Please enter your required option: ")
Console.WriteLine("==================================")
Console.WriteLine("Enter 1 to list all members who have chosen to be volunteers,")
Console.WriteLine("Enter 2 to list all volunteers who would like to work at the pier entrance gate.")
Console.WriteLine("Enter 3 to list all volunteers who would like to work in the gift shop.")
Console.WriteLine("Enter 4 to list all volunteers who would like to help with painting and decorating tasks.")
Console.WriteLine("Enter 5 to list all members whose membership has expired.")
Console.WriteLine("Enter 6 to list all members who have not yet paid their $75 fee.")
Console.WriteLine("Enter 0 to exit this program.")
response = Console.ReadLine()
If Not isNumeric(response) Then
Console.WriteLine("Invalid entry - you must enter a number")
response = Console.ReadLine()
else if cint(response) < 0 OR cint(response) > 6
Console.WriteLine("Invalid enter - you must enter a number in the range of 0 to 6")
response = console.ReadLine()
do while arrayindex <= Firstnames.Length -1
if not VolunteerChoices(arrayindex) = 0 then
Console.WriteLine(Firstnames(arrayindex) & " " & surnames(arrayindex))