Question
write a program that maintains two parallel arrays. after th arrays have been loaded the program should behave as a login screen prompting for username and password. the program should respond three output messages. if username does not match one of the values in the username array, then the message should be "username not found". if the user name is found in the username array, but the password does not equal the parallel value in the password array then message should read "username and password do not match". if username is found and the password matches the message should read "access granted"
here is the code i have so far right now im stuck and not sure how to get the arrays to match up. I also don't know how to clear the screen after i have the username and passwords stored.
Dim user(0 To 4) As String
Dim password(0 To 4) As String
Dim input As String
For x As Integer = 0 To 4
Console.Write(" Please enter a username: ")
user(x) = Console.ReadLine()
input = user(x)
Next
Dim input2 As String
For y As Integer = 0 To 4
Console.Write(" Please enter a password: ")
password(y) = Console.ReadLine()
input2 = password(y)
Next
Console.Write(" Please enter in your login ")
Console.Write(" User name ")
Console.ReadLine()
Console.Write(" Password ")
Console.ReadLine()
here is the code i have so far right now im stuck and not sure how to get the arrays to match up. I also don't know how to clear the screen after i have the username and passwords stored.
Dim user(0 To 4) As String
Dim password(0 To 4) As String
Dim input As String
For x As Integer = 0 To 4
Console.Write(" Please enter a username: ")
user(x) = Console.ReadLine()
input = user(x)
Next
Dim input2 As String
For y As Integer = 0 To 4
Console.Write(" Please enter a password: ")
password(y) = Console.ReadLine()
input2 = password(y)
Next
Console.Write(" Please enter in your login ")
Console.Write(" User name ")
Console.ReadLine()
Console.Write(" Password ")
Console.ReadLine()
Answers
Write a program that reads 10 username and password values into parallel arrays. After the arrays have been loaded, the program should behave like a login screen, prompting for a username and a password. Based on the data read and stored in the arrays, the program should respond appropriately with one of three output messages: “Username not found.”, “Username and password does not match.” or “Access granted.” in visual logic
Related Questions
Write a program reads the city names and respective gas prices into 2 single-subscripted arrays in y...
Create three arrays of type double. Do a compile-time initialization and place different values in t...
. Write a program that allows a small business owner to input, in parallel arrays, the type of item,...