I'm trying to assign values to corresponding Indexes. I'm using the find method but all of the printouts show the last entered item for each index. The math is correct but there's a bug in the code i can't figure out.
Marilyn added code tags [ October 30, 2002: Message edited by: Marilyn de Queiroz ]
Could you please write a smaller program which shows the problem, or point out where in this piece of code you are seeing the problem. And give a specific example. Like: items contains the value "tree", instead of "tower".
Please ignore post, I have no idea what I am talking about.
Hi! I am doing the same project in my ISYS 216 class at FSU. I'm in the 9:00 class. The only thing I noticed with your program is that u need braces for the if statements in the find() method and both of the store() methods.
Amy is correct, although in the find method it is less important because you only have one line after the if statement. In both of the other two methods you'll only execute the first line after the if statement if it is true, the other two following lines will always be executed. Putting the braces around the if statement (Even if it is only one line) is not a bad idea to get into. If you really hate them on one liners then put the line to be executed on the same line as the if statement itself.