Dim username, password, firstname, surname, emailAddress, domain, yearJoined as string
Dim loginAttempts as integer
Console.WriteLine("Enter your username: ")
username = console.readline()
Console.WriteLine("Enter your password: ")
password = console.readline()
If login(username, password) = True then
Console.WriteLine("Login successful.")
Console.Writeline("Invalid login.")
If loginAttempts = 3 then
Console.WriteLine("You have reached the number of login attempts.")
Loop Until login(username, password) = True
Console.WriteLine("Welcome to the email generator for Crossley Heath.")
Console.WriteLine("Enter your first name: ")
firstname = console.readline()
Console.WriteLine("Enter your surname: ")
surname = console.readline()
Console.WriteLine("Enter the year you joined Crossley Heath: ")
yearJoined = console.readline()
domain = "@crossleyheath.org.uk"
emailAddress = firstname.substring(0, 2) + surname + yearJoined.substring(2, 2) + domain
Console.WriteLine("Your school email address is: " & emailAddress)
Public Function login(ByRef username as string, ByRef password as string) As Boolean
If username = "Test" and password = "1234" or username = "10W" and password = "CHS" then