Noel is creating a music quiz game.
The game stores a list of song names and their artist (e.g. the band or solo artist name). The player needs to try and guess the song name.The game is played as follows:
- A random song name and artist are chosen.
- The artist and the first letter of each word in the song title are displayed.
- The user has two chances to guess the name of the song.
- If the user guesses the answer correctly the first time, they score 3 points. If the user guesses the answer correctly the second time they score 1 point. The game repeats.
- The game ends when a player guesses the song name incorrectly the second time.
Only authorised players are allowed to play the game.
Where appropriate, input from the user should be validated.
Develop a program that:
- Allows a player to enter their details, which are then authenticated to ensure that they are an authorised player.
- Stores a list of song names and artists in an external file.
- Selects a song from the file, displaying the artist and the first letter of each word of the song title.
- Allows the user up to two chances to guess the name of the song, stopping the game if they guess a song incorrectly on the second chance.
- If the guess is correct, add the points to the player’s score depending on the number of guesses.
- Displays the number of points the player has when the game ends.
- Stores the name of the player and their score in an external file.
- Displays the score and player name of the top 5 winning scores from the external file.