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 surname 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 member's volunteering option: ")
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()
elseif cint(response) < 0 OR cint(response)> 3 then
Console.WriteLine("Invalid entry - you must enter a number in the range 0 to 3")
response = Console.ReadLine()
Console.WriteLine("Please enter the start date in the format DD/MM/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. Correcly formated dates will have 11 characters")
response = Console.ReadLine()
elseif 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 characters should be '/'")
response = Console.ReadLine()
elseif not isDate(response) then
Console.WriteLine("The date entered is not a valid date")
response = Console.ReadLine()
elseif cdate(response) > Today then
Console.WriteLine("This date is invalid - it is in the future")
response = Console.ReadLine()
elseif dateadd("yyyy",-4, Today) > cdate(response) then
Console.WriteLine("The date entered is too far in the past. All date should bein the last four years.")
response = Console.ReadLine()
JoiningDates(Count) = cdate(response)
Console.WriteLine("Has the member paid their fee - 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
Console.WriteLine("Do you want to add 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 wouuld 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 like to help with painting and decorating tasks.")
Console.WriteLine("Enter 5 to list all members whose mebership has epired.")
Console.WriteLine("Enter 6 to list all members who have not yet paid their $75 fee.")
Console.WriteLine("Enter 0 to exit the program.")
response = Console.ReadLine()
If Not isnumeric(response) Then
Console.WriteLine("Invalid entry - you must enter a number")
response = Console.ReadLine()
elseif cint(response) < 0 OR cint(response) > 6 then
Console.WriteLine("Invalid entry - you must enter a number in the range 0 to 6 ")
response = Console.ReadLine()
elseif response = "1" then
Console.WriteLine("All pier entrance gate volunteers: ")
elseif response = "2" then
Console.WriteLine("All volunteers: ")
elseif response = "3" then
Console.WriteLine("All gift shop volunteers: ")
elseif response = "4" then
Console.WriteLine("All volunteers for painting and decorating: ")
elseif response = "5" then
Console.WriteLine("All members whose membership has expired ")
elseif response = "6" then
Console.WriteLine("All members who hae not paid their $75 fee: ")
do while arrayIndex <= FirstNames.Length -1
if FirstNames(arrayIndex) <> "" then
if not VolunteerChoices(arrayIndex) = 0 then
Console.WriteLine(Firstnames(arrayIndex) & " " & Surnames(arrayIndex))
elseif CInt(response) > 1 AND CInt(response) < 5 then
if VolunteerChoices(arrayIndex) = CInt(response) - 1 then
Console.WriteLine(FirstNames(arrayIndex) & " " & Surnames(arrayIndex))
arrayIndex = arrayIndex + 1