Question: Soccer Project: The program allows the user to add players to the league, edit a player s information, print lists of players and search for
Soccer Project: The program allows the user to add players to the league, edit a players information, print lists of players and search for players using a variety of criteria. For each player, the program will record the players name, year of birth, category and registration status. The possible categories are U U U U U and U The registration status is either paid or not paid. Views The program provides the user with two views. The main view allows the user to execute certain commands such as adding new players and searching for players. The search results view is entered after a search. In this view, the user browses through the players produced by the search. An exit command allows the user to return to the main view. In the main view, the user is presented with a menu of commands, as detailed below. In the search results view, players are shown one at a time. Two commands, next and previous, allow the user to view other players. Players are presented alphabetically by last name and then first name. To keep things simple, in this version of the program, assume that no two players share the same full name. In the search results view, the program displays the rank of the current player in the search results and the total number of players in those results. For example, when viewing the th player after a search that returns players, the program might display or out of Commands Most commands are available in only one of the views, as noted below. Some commands are available in both views and one of those behaves differently depending on the view. Start a new season. The user provides a year and the program deletes all the existing players. Before deleting, the program asks for a confirmation. Available only in the main view. Add a player. The user provides the name, year of birth and registration status of a player and the program adds that player to its list. The category is automatically computed. Should run in logarithmic time. Available only in the main view. Search for players. The user provides any combination of last name, first name, keyword, year of birth, registration status, and category. The program searches for players that match all the information provided and then enters the search results view. If no matching players are found, a message is printed and the program remains in whatever view it was in In the search results view, the program searches all the players, not just those being displayed. If a string is specified as keyword, the program should display all the players whose first or last name contains that string. All the searches can run in time linear in the total number of players, except when a string is specified for the last name. In that case, the running time should be logarithmic in the total number of players plus linear in the number of players with the given last name. Move to the next or previous player. As explained above, these work in alphabetical order. And theyre circular: from the last player, moving to the next player moves to the first player; from the first player, moving to the previous player moves to the last player. Available only in the search results view. Edit a players information. The program allows the user to change the name, year of birth and registration status of the player currently displayed. If needed, the category is recomputed automatically. Should run in logarithmic time. Available only in the search results view. Print a list of players. This command is optional if you are doing the project by yourself. The program asks the user for the name of a file and writes players to that file. In the search results view, only the players produced by the last search are written to the file and they are written in alphabetical order. In the main view, all players are written to the file and they are written by category. Within each category, they are written in alphabetical order. Exit the search results view. Returns the program to the main view. Available only in the search results view. Display statistics. This command is optional if you are doing the project by yourself. The total number of players, the number who have paid and the number who havent paid, in total and for each category. Available only in the main view. Stop the program. Any changes to the list of players are saved for the next session. Available in both views. Categories Ux stands for Under x For example, U is for players that are younger than years old and U is for players that are or Players younger than or older than cannot play in this summer league. If the user attempts to add such a player, the program should not do it and instead print an explanation. The age of a player is computed by subtracting the year of birth from the year of the current season.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
