For this lab you don't need to make any new classes, you only need to add code to the existing methods
The OneLine class has the first method that needs to be edited. If you go down to the compareTo method you will see the comment (YOU MUST FILL IN THIS CODE). For this what we need to do is if the contests are different you will return 1 or -1, depending on what the compareTo for string returns. If the contests are the same but the candidates are different then you will return -1 or 1, again depending on what the string compareTo returns. If they are both the same then you will return 0.
In the VoteCount class you need to first add the ArrayList to hold the OneLine objects. It is going to be called theList, as that is what it is called in the toString that is already written. Next you should initialize theList in the constructor. The methods insertionSort and pullLineForward are the same as from ManagedList in Lab04, so you can go back and pull them in (reusing code!). The doTheWork method is also pretty much the same as what you had in Lab04, you just need to add a call to countTheVotes. countTheVotes is the last method you need to do. It is a long one so I included Dr. Buell's comments in the files I gave you. The first thing you will need to do is look at the sample output file and look at the bottom to see how everything is being formatted as it is being output. You will see that the first thing you will see is the total ballots cast. You can use the isNewBallot method in the OneLine class to check this. Next you will see all of the candidates listed in order. You will have to keep track of how many of each vote there was so you need a counter variable. From here you will count up and if the contest or the candidate changes then you will print out the data (more compareTo) and reset the counter.
Zip up the folder and submit to dropbox!