Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions