First modify the Skier class, all methods are missing code. Start with
the constructor, what needs to be initialized here?
Then continue writing code for all the methods. You'll need to read the
comment
for each method to see its purpose.
For the method generateRaceTime,
This method should generate a random number from 15 to 26 and return it.
Next we will modify the SkiRace class.
Finish the constructor. Assume the scanner is ready to read from the
file
skidata.txt. This file has a skiers' name on a line by itself (one word), followed
by the skier's number, an integer, on a line by itself; followed by other pairs of
lines representing names of skier and skiers' numbers.
Write the method skiRound that generates a random race time for each
skier and changes their best time to this time if it is faster.
Write the method printResults which prints the name, number and best
time for each skier. If a skier has not skied yet, it's best time should
be printed as 0.
Last, we will modify the method RunSkiRace which contains
the main method.
Read in data from the file skidata.txt which contains the name of a
skier (one word) and the number of a skier for many skiers. Note that you
want to create a SkiRace. Also note, where have you done some of this
work already?
Run three rounds of a ski race (each skier skies three times).
Print the results for each skier.
Print a message "Best skier(s) is:" followed by the name(s)
of the best skier(s).