adding an entry the most interesting method of the scoreboard class is addwhich is responsible for considering the addition of new entry to the scoreboard keep in mind that every entry will not necessarily qualify as high score if the board is not yet fullany new entry will be retained once the board is fulla new entry is only retained if it is strictly better than one of the other scoresin particularthe last entry of the scoreboardwhich is the lowest of the high scores when new score is consideredwe begin by determining whether it qualifies as high score if sowe increase the count of active scoresnunless the board is already at full capacity in that caseadding new high score causes some other entry to be dropped from the scoreboardso the overall number of entries remains the same to correctly place new entry within the listthe final task is to shift any inferior scores one spot lower (with the least score being dropped entirely when the scoreboard is fullthis process is quite similar to the implementation of the insert method of the list classas described on pages - in the context of our scoreboardthere is no need to shift any none references that remain near the end of the arrayso the process can proceed as diagrammed in figure jill rob anna mike paul rose jack figure adding new gameentry for jill to the scoreboard in order to make room for the new referencewe have to shift the references for game entries with smaller scores than the new one to the right by one cell then we can insert the new entry with index to implement the final stagewe begin by considering index self which is the index at which the last gameentry instance will resideafter completing the operation either is the correct index for the newest entryor one or more immediately before it will have lesser scores the while loop at line checks the compound conditionshifting references rightward and decrementing jas long as there is another entry at index with score less than the new score