Question: The code in the following sections assumes that the entries in the racer array are added in the order that the racers finished. Show how

The code in the following sections assumes that the entries in the racer array are added in the order that the racers finished. Show how to modify the addRacer method to ensure that this is true. You should assume that the RacerInfo class includes a method named getTimeInSeconds that converts the String used to represent the finishing time when a RacerInfo object is created into an int that expresses the finishing time in seconds. As we did in the version of addRacer shown in Figure 14.20, your version should not bother to display an error message if an attempt is made to add a racer out of order. Instead, your method should simply return without actually adding information about the new racer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!