• Post Reply Bookmark Topic Watch Topic
  • New Topic

code the program to search an array for authentication when the login button is clicked

 
Gezelle Ealey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed the code tags which you put into your post so that they were around the code to be formatted, rather than before it. So now it looks much better, right?

As for your question, there's no array in your code so it's pretty hard to explain how to search it. You also didn't say what you were supposed to be looking for in the array. Not to mention that the idea of searching the array and the password and the ID makes it even more confusing. Hopefully you have more detail in the actual requirements than what you posted there?
 
Gezelle Ealey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using an Applet to Search an Array:
What you are viewing is the code for a Login interface that has been coded already. I need to
1. Write the code to complete the applet and create two array, one for the IDs and
one or the corresponding password.
2. Assign some sample IDs and passwords to elements of the arrays.
3. Use the for loop that loops through the array, searching for a valid ID and password.
4. Use an if statement in the or loop to look at each member of the array and,
5. Set a flag to true if the ID and password match an array member.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay. There are some ambiguities there, but as far as I can see you are part way through step 1. Now you need to create two arrays in the code (the rest of step 1) and put some values into those arrays (step 2). Can you do that?
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Giselle,

It looks like you edited your original post. And when you did that, it made the rest of the thread look totally meaningless. Editing posts for minor details is okay but please don't replace the entire contents of the post. So I reverted your original post to the way it was originally; please go ahead and repost what you did as a new reply at the end of the thread.

Thanks for your consideration.
 
Gezelle Ealey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I declared the arrays as you asked. In the actionperform, I am not sure how to code the second array for the userid. I commented-out, the portion of the program that would not compile although I included the correct statements, it would not compile. So, if you could look over what I have and let me know what I a dong working. I am speaking of the "Search".
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gezelle Ealey wrote:So, if you could look over what I have and let me know what I a dong working.


Sure. Let's start by you posting what you have, since it's not very practical to discuss code which only you can see.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!