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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!