The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Java assignment

Knox United is a sports club that organises various sporting teams, their games and their
training schedules. Players register with the club and are allocated to a team. Knox United are
planning to release a pilot (trial) version of the software that manages the registration and
scheduling process and you have been hired to develop it in Java.
Below are the requirements of the software:

Getting Started:
1. Create a new project in BlueJ called Assignment1. All classes for the assignment are to be
saved in this project.

2. Create the required classes for the project - there should be at least three (3) classes: Club,
Team and Player. You can have any number of additional classes you think are required.

3. Class basics:
Club Ė a club has a name, address, licence number and 12 month registration fee. It also
has 4 teams (for the pilot version).
Team Ė a team has a name, training day, training time and a maximum age the players can
be. It has a maximum of six players, and as each player registers with the club they are
added to a team. The Team class also has a counter which holds the value of how many
Players are currently in the Team.
Player Ė a player has a name, age, email address and phone number. There is also data
indicating whether the Player has been allocated to a Team or not (Y/N). The Player class
records how much was paid at registration and whether or not a receipt was issued.

4. Constructors: all classes must have at least 1 alternate constructor that accepts input
parameters used to initialise the class attributes (done in the body of the constructor).
Functionality:
The software must provide these functions:
- Update the name, address, licence number and 12 month registration fee for the Club
- Update the name, training day, training time, maximum age limit and number of players for
a Team
- Update the email address, phone number, allocated to a Team (Y/N), registration cost and
whether or not a receipt was issued for a Player
- Teams can be created in the club (maximum of 4)
- Players can register with the club i.e. become a member
- Teams are chosen for a Player
- Players are added to a team
- The club can record the training day and time for teams

NOTE: It is expected that if an error occurs e.g. if a player does not provide enough money to pay
for registration, then the system will display an appropriate error. This applies for all common
errors.

Detailed Functionality:

1. Update the name, address, licence number and 12 month registration fee for the Club.
It must be possible to update the name, address, licence number and 12 month registration
fee for the Club. This should be done in four separate methods.

2. Update the name, training day, training time, maximum age limit and number of players in a
Team.
It must be possible to update the name, training day, training time, maximum age limit and
number of players in a Team. This should be done in five separate methods.

3. Update the email address, phone number, allocated to a Team (Y/N), registration cost and
whether or not a receipt was issued for a Player.
It must be possible to update the email address, phone number, allocated to a Team (Y/N),
registration cost and whether or not a receipt was issued for a Player. This should be done
in five separate methods.

4. Create a new Team
A new Team can be created in the system by entering all the team details: name, maximum
age of the players, training day (if known), training time (if known). If a team with the same
name already exists in the system, display an error message and do not create the Team.
All new Teams must have the counter of the number of Players set to zero.

5. Register players - players become members of the club
Players register with the club and provide details such as name, age, email address, phone
number. This data is entered into the system. The Player must pay the required registration
fee and any change required and receipt is issued to the Player. The Player is then
allocated to a suitable Team by the Club (see below for more details). The method to
register players should be part of the Club class.

6. Choose Team for a Player
The Club class must have a method that decides on which Team a Player will join. The
Team must have enough room for the Player to join (i.e. the Team is not full).

7. Add a Player to a Team
The Team class must have a method that adds a Player. The Player is added if the Player
isnít in the Team already, if the Players age is less than the maximum age allowed and if
the Player isnít allocated to another Team. If any of these criteria are not met, display an
error message and do not allocate the Player to the team. If all criteria are met, the Player
is allocated to the Team.

8. Record the Training Day and Time for a Team
The system must be able to record the Training Day and Time for team. Only one team can
train on a given time and day. Training sessions are for one hour only, and do not run on
Sundays.

NOTE: It is expected that if an error occurs e.g. if a player does not provide enough money to pay
for registration, then the system will display an appropriate error. This applies for all common
errors.

Program Flow:

Add a main method to the project (in Club or another class) so that:
a) one Club object is created
b) two Team objects are created
c) four Player objects are created

The main method will then be used to simulate the usage of the system. All functionality listed
above must be demonstrated Ė an example simulation could be:

- Display the name and address of the Club
- Display the names of each Team (2) and itís Players (2 each to start with)
- Demonstrate update methods for Club
- Demonstrate update methods for Team
- Demonstrate update methods for Player
- Create a new Team
- Register a new Player
- Allocate the new Player to an existing Team
- Record the training day and time for a Team