You somehow forgot the surfer names

With your rush to catch some waves before the light is gone, you forgot about the other piece of data stored in the results . txt file: the name of each surfer.

Without the names, you can't possibly know which score goes with which name, so the scoreboard is only half-complete.

The trouble is, your array stores one data item in each element, not two. Looks like you still have your work cut out for you. There'll be no catching waves until this issue is resolved.

you -fovyj-t "to pvodess -the ndmes.

Name

Score

Johnny

8.65

Juan

9.12

Joseph

8.45

Stacey

7.81

Aideen

8.05

Zack

7.21

Aaron

8.3!

How do you think you can remember the names and the scores for each surfer in the contest?

Once you've thought about this problem, turn over to Chapter 5 and see if you can resolve this issue.

programming toolbox

Your Programming Toolbox

You've got Chapter 4 under your belt. Let's look back at what you've learned in this chapter:

PytKo, TOOIS

nMfr ^ ' * - open a file fG, mdc* . to\\ett>orv m

ovdcv

.Itiple

* for - iterate over something

• the array index operator

* - change the order of an an-ay by reversing it

5 hashes and databases

Was this article helpful?

0 0

Post a comment