File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Arrays" Watch "Arrays" New topic
Author

Arrays

John Perry
Greenhorn

Joined: Oct 21, 2006
Posts: 5
Hello, i'm having problems storing data into an array. I'm trying to store strings and doubles, but the data does not get stored properly.

Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I think you need to rethink your addScore method. There is a problem with the logic.
John Perry
Greenhorn

Joined: Oct 21, 2006
Posts: 5
I will need the method later on for validation.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by John Perry:
I will need the method later on for validation.

I think Keith is suggesting that there is a problem with the logic inside that method body -- not that the method itself shouldn't be there.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Hi John,


your loops are nested.
Guess how many values i can have before the first return.
Here's how addScore looks, if properly indented:



Yours,
Bu.
John Perry
Greenhorn

Joined: Oct 21, 2006
Posts: 5
I have modified my code, however i do not understand why i'm getting duplicates. If i type in "Judge1" and score "10", then i type in "Judge2" and score "9", i get a duplicate:



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Arrays
 
Similar Threads
cant find methods
Battleships - guys please help me out!
third attempt at solving this
losing data
Using GridLayout as GUI