High Score program
Make a high score text file, with a reasonable name
Name,score ←←← this is optional
PETER,67890
HOLLY,40404
KARL,18000
VICTOR,12001
FREYA,9999
ALBERT,9000
Program Requirements
- READ in the high score file
- ask the user for their name and score (or you could allow multiple entries, and have a way for the user to exit)
- if there are 10 or fewer high score entries, then add their score, but it needs to be in the correct place
- if there are already 10 entries, then only add their high score if it's more than the lowest one
- The high score file always remains sorted from highest to lowest
- You should never have more than 10 entries in your high score file
- Print out the high scores and also
- 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.
The high score file is ALWAYS sorted properly with highest score at the top. Write it out this way too.