High Score program

Make a high score text file, with a reasonable name

Example

Name,score  ←←← this is optional
PETER,67890
HOLLY,40404
KARL,18000
VICTOR,12001
FREYA,9999
ALBERT,9000

Program Requirements

  1. READ in the high score file
  2. ask the user for their name and score (or you could allow multiple entries, and have a way for the user to exit)
  3. if there are 10 or fewer high score entries, then add their score, but it needs to be in the correct place
  4. if there are already 10 entries, then only add their high score if it's more than the lowest one
  5. The high score file always remains sorted from highest to lowest
  6. You should never have more than 10 entries in your high score file
  7. Print out the high scores and also
  8. WRITE out the high scores to the file at the end of your program

Obviously, after running it 4 times, you'll have all 10 entries.

Do error checking: no negative or zero scores. You must enter a name.

The high score file is ALWAYS sorted properly with highest score at the top. Write it out this way too.