Dim hasUpper, hasLower, hasDigit, HasSymbol As Boolean
Console.Write("Please enter your password: ")
password = console.Readline()
numChar = password.Length
For i As Integer = 0 To password.Length - 1
currentChar = password.Chars(i)
If Char.IsUpper(currentChar) = True Then
If Char.IsLower(currentChar) = True Then
If Char.IsDigit(currentChar) = True Then
If Char.IsLetter(currentChar) = False And Char.IsDigit(currentChar) = False Then
If numChar >=8 And hasUpper = true And hasLower = true And hasDigit = true And hasSymbol = true Then
Console.WriteLine("Password Accepted.")
Console.WriteLine("Error: Password must contain at least 8 characters.")
ElseIf hasUpper = false Then
Console.WriteLine("Error: Password must contain one uppercase letter.")
ElseIf hasLower = false Then
Console.WriteLine("Error: Password must contain at least one lowercase letter.")
ElseIf hasDigit = false Then
Console.WriteLine("Error: Password must contain at least one digit.")
ElseIf hasSymbol = false Then
Console.WriteLine("Error: Password must contain at lease one symbol.")