Back to Challenge Set 14

Code Challenge: High Score Table

Difficulty  

divider

The Brief

What they asked for
The arcade cabinet keeps the players and their scores in two
lists that line up. I want the top score, who got it, and how
far above the average that top score is.

Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.


Notes

  • Start with two arrays: players Avery, Blake, Casey, Dakota, Emery, and scores 4200, 5150, 3900, 6100, 4800. Avery scored 4200.
  • Two arrays kept in step by index — the parallel arrays from Activity 1.25.
  • Finding the top score is easy. Finding who got it is the challenge, and it means keeping the position where you found it. The name is at the same index in the other array.
  • Report the distance above the average to one decimal place.

Sample Output

Sample Output
Top score: 6100 by Dakota
That is 1270.0 above the average of 4830.0.

Verified in a real run.


Submit

Your requirements list and your program file, named cc-high-score-table.

Commence Challenge