Question
Use an If...Else statement. Using the logical operator And, combine the return value from calling the VerifyUsername and VerifyPassword functions. What has already been written
Use an If...Else statement. Using the logical operator And, combine the return value from calling the VerifyUsername and VerifyPassword functions.
What has already been written is as follows....
Module Main
Dim blnLoggedIn As Boolean Dim arrUsernames() As String {"Admin", "Clerk", "Manager"} Dim arrPassword() As String {"P@ssword", "pa$$word", "passw0rd"}
Sub Login(username As String, password As String)
End Sub
Function VerifyUsername(username As String) As Boolean
End Function
Function VerifyPassword(password As String) As Boolean
End Function
Sub Login(username As String, password As String) blnLoggedIn = False If VerifyUsername(username) And VerifyPassword(password) Then 'Find index for username Dim userIndex As Integer For loopIndex = 0 To arrUsernames.Length - 1 If arrUsernames(loopIndex) = username Then userIndex = loopIndex Exit For
End If
Next 'Check for password match If arrPassword(userIndex) = password Then blnLoggedIn = False Else MessageBox.Show("Incorrect Password.") End If End If End Sub End Module
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started