Creating a new user account.
A gamertag is a persona used to identify players in online games. A gamertag can include letters, numbers and symbols, but no two players can share the same gamertag. This program allows a player to enter their preferred gamertag and prevent other players from claiming it.
Write a program that asks the user to enter a gamertag. If the gamertag already exists in a file an error message is output, otherwise the gamertag is appended to the file.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
`players.txt` file:
FluidYosta
IdolizedMero
TimotheosDark
DemonCamping
Enter your chosen gamertag: DemonCamping
Sorry, that gamertag is already taken. Try again.
Enter your chosen gamertag: DemonRushing
Welcome DemonRushing
Enter your chosen gamertag: OnlyUseMePistol
Welcome OnlyUseMePistol
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Remember to reset the data file if your program successfully writes data to the file before running the unit tests.
Enter your chosen gamertag: IdolizedMero
Sorry, that gamertag is already taken. Try again.
Enter your chosen gamertag: FluidYosta
Sorry, that gamertag is already taken. Try again.
Enter your chosen gamertag: DesperateDan
Welcome DesperateDan
Check that you have: