Imports Microsoft.VisualBasic
Dim FirstNames(99) as string
Dim Surnames(99) as string
Dim VolunteerCoices(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 of 0 to 3")
response = Console.ReadLine()
console.WriteLine("Please enter the start date in the format 'DD/MMM/YYYY' (e.g. 05/12/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 in 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("The date is 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 must 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()
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
Dim ContinueToLoop as boolean
dim arrayIndex as integer
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 of 0 to 3")
response = Console.ReadLine()
console.WriteLine("Please enter the start date in the format 'DD/MMM/YYYY' (e.g. 05/12/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 in 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("The date is 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 must 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()
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 whos membership has expired.")
Console.WriteLine("Enter 6 to list all members who have not 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()
elseif cint(response) < 0 OR cint(response) > 6 then
console.WriteLine("Invalid entry - you must enter a number in the range of 0 to 6")
response = console.ReadLine()
elseif response = "1" then
Console.WriteLine("All volunteers: ")
elseif response = "2" then
Console.WriteLine("All pier entrance gate 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 have not yet 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))
elseif response = "5" then
if DateAdd("yyyy", 1, JoiningDates(arrayIndex)) < Today
console.WriteLine(FirstNames(arrayIndex) & " " & Surnames(arrayIndex))
elseif response = "6" then
If not FeePaid(arrayIndex) then
console.WriteLine(FirstNames(arrayIndex) & " " & Surnames(arrayIndex))
arrayIndex = arrayIndex + 1