Page 161 -
P. 161

more top scores


           But you need more than one top score


          As soon as the top score appears, people start to wonder what the
           second and third highest scores are:



                You are missing some            Surf-A-Thon                                  What about second
                               nd
                scores here... the 2                                                         and third place?
                     rd
                and 3  scores are a                1.     9.12
                mystery.
                                                   2.     ???
                                                   3.     ???











           It seems that the organizers didn’t tell you everything you
           needed to know. The contest doesn’t just award a prize for the
           winner, but also honors those surfers in second and third place.

           Our program currently iterates through each of the lines in the   Looks like you need extra
           results.txt file and works out the highest score. But what it   variables for the second and
           actually needs to do is keep track of the top three scores, perhaps   third highest scores.
           in three separate variables:


                                highest_
                                score                                                third_
                                                                                     highest
                                                      second_
                                                      highest
                      “9.12"
                                                                            ?

                                              ?












           126    Chapter 4
   156   157   158   159   160   161   162   163   164   165   166