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 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/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()
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 character 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 in invalid - it is in the future")
response = Console.ReadLine()
elseif dateadd("yyyy", -4, Today) > cdate(response) then
Console.WriteLine("The date 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 - 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()