I am assuming by visual logic, you mean a logic flowsheet or pseudocode. Here is my look at the problem:
Initialize username array
Initialize password array
Enter user data into username and password array
Get username_input and password_input from user
[Check if username_input is in username array]
If NO -> output pop-up saying "User not found" and end program
If Yes -> store array index of username_input from username_array into username_array_index (should be a number from 1 to 5) and continue on with algorithm
[Check if password_input is in password array]
if No -> store "0" into password_array_index (no for sure there won't be a match)
if Yes -> store array index of password_input from password_array into password_array_index (a number from 1 to 5 again)
[Check to see if username_array_index is the same as password_array_index]
If No -> output pop-up saying "Username does not match password"
If Yes -> output pop-up saying "Access Granted"
Cheers and hope that helps out a bit with the logic.
I'm trying to write a program in Visual Logic using parallel arrays where:
1) you enter 5 usernames and 5 passwords into an array
2) you then get a dialog box asking for a username and password
3) if the username is not one of the 5, you get a pop-up saying "User not found"
4) if the username and password do not match, you get a pop-up saying "Username does not match Password"
5) if they DO match, you get a pop-up saying "Access Granted"
I know that I am entering the parallel arrays right.
I know that I am properly setting up the initial inputs
But how do I set up the logic statement to get the program to KNOW if the username exists and matches the password?
Can someone flowchart it for me?