CSC 148 Fall 2002 Assignment 3: Team Players and OO Design Introduction: The Canadian National Diving Team has hired you to write a program to manage the list of team members and the list of players who would like to get onto the team. You figure that if you do a good job for the Diving team your program could be marketed to the Canadian Scrabble team and others so you should do a good job and create a general solution. Specific needs: You interview the Executive Director of the Diving Canada to find out their requirements. This is what you find out: There is a fixed number of members on the team. There can be any number of players who want to get onto the team. Players, whether on the team or hoping to get onto the team, have a point count and this is what is used to decide whether they are on the team. While it is possible that there are fewer divers than there are places on the team, this is nearly never true. Effectively the team is always full and there are players who want to get onto the team. Team members can be removed from the team because of injury. These players are stored with the other players but have an injured status. Team members can also be bumped from the team by a player accumulating a point score greater than at least one player on the team. The bumped team members are added to the list of players hoping to get onto the team. Bumping based on points is not automatic when a player attains a better point score than someone of the team. It is initiated by a request from the record keeper (coach) to regroup. Team members can be bumped from the team by a player who is no longer injured and has a point score greater than at least one player on the team. If there is a tie in the number of points that two players have accumulated, for ranking purposes the tie is broken by comparing the date when the player was first registered with the team either as a team member or a player who wanted to be on the team. (Because of diving superstition only one player is allowed to register per day so there can never be a tie of dates. You can assume this in the logic of your program.) The different transactions are register a player, record a players participation in an event and their number of points, record a player's injury, record a player's recovery, request a display of the team members in order of their points and request a display of the players not on the team in order of their points. What to do: Design a program that can be used to manage the team members and players lists. Your design should define a general ADT. If appropriate you should extend your ADT to solve the specific problem of storing member and player information. You must implement the ADT to store each of the members and players lists. (A different implementation may be appropriate for each of the lists.) Hints: When you are designing your solution think about where interfaces would be useful defining the operations that are needed in a class or set of classes. Also think about efficiency while designing your solution. Once you have completed your design write a Java program that implements your design. Each of your classes should include full documentation in JavaDoc format. Methods should include pre and post conditions where appropriate. And classes should include representation invariants where appropriate. Your program must read the input in the format provided. Your structure that manages all the data must include a toString method that when used in a print statement produces output as required. Provide a document that describes your design and logic underlying your design. This document should be less than 1500 words in length. The document must be a text file with a maximum line length of 80 characters. (Do not submit Word or other formatted documents!) Marks will be awarded for concise, careful wording. Marks will be deducted for rambling or repetitive prose. You should explain how you separated the functionality of the program between the various classes and why. You should explain why you believe your program achieves a desirable level of efficiency. You should explain what decisions you make about how to store the lists to achieve reasonable efficiency. Details: The main program will handle the input and output. The input will be an integer value indicating the maximum size of the team followed by a list of transactions and requests for output. We will provide a sample input file and resulting output file in the assignment web site. The format of the transactions in the input will be: Register Event Points <Name> <Points> Injuries <Name> <Name> Recover <Name> Regroup Team Status Player Ranking The end of the input is signaled by stop What to hand in: A complete set of your .java files. Your class that contains the main method must be called TeamDriver and the file called TeamDriver.java. Marking: The marking scheme is based on your design. Your description of the logic behind your design. Your program style and documentation.