Start New Discussion within our Software Development Community

I need help writing this code i been working for a day now on it and i cant seem to get it. i need help with this code if any one can help. I am taking java and this is the first program i cant get. thank you guys so much.

Write a class which represents a list of three high scores. Call this class HighScores. The class will have the following data and operations:

A no-argument constructor. This constructor may initialize your variables.
A method called addScore which takes an integer score and String initials. This method will ensure that only initials of exactly length 3 are entered. This method will return a boolean:
true - when the score was high enough to be in the top 3 scores
false - when the score isn't high enough to be in the top 3 or initials of length other than 3 were given
A method called drawScores which prints each initials and score on a separate line. This list will be ordered by score, highest first.


You may make other variables, methods, or classes within HighScores but they must be private. Only the constructor and two methods listed above will be public. To get the most points create a private class defined in HighScores which represents a single score-initials pair. You may define whatever methods or variables you wish within this inner class. Design is very important on this assignment, getting it to work is only half the battle. Strive for short, easy to read code which doesn't contain duplicate lines. Use public/private keywords appropriately. Group related variables together either via a class or array.

This article has been dead for over six months. Start a new discussion instead.