Ahhhhh...I see what copeg is getting at. You could make a Team class that keeps track of the score for that Team.
//code removed by moderator
I'm hoping that no two schools have the exact same...
Type: Posts; User: javapenguin
Ahhhhh...I see what copeg is getting at. You could make a Team class that keeps track of the score for that Team.
//code removed by moderator
I'm hoping that no two schools have the exact same...
Also, I was wrong. Your name array won't be lost. What will be lost however will be the number of schools you got in getNumberOfSchools(). If you changed the return type to int, then
names =...
For tallying up the scores, parallel arrays would be a good idea.
Make an index, say index 0, for a school in a String array.
Then make a bunch of int arrays to store scores for each category...
Your getSchoolNames should be of type String[].
You're storing them but since names in just defined inside that method, it goes out of scope when that method ends.
Void methods don't return anything.
The values entered will be lost when you exit the method.
Unless you change the return type to int or String or whatever you need to.