Highlights
Part
1. AFLTeamMember
You will implement a class AFL Team Member. Each team member (players, coaches, etc.) has a name and a position. You will implement this class, including getter and setter methods as appropriate. The positions on an AFL team are as follows: FB, HB, C, HF, FF, FOL, IC, and COACH. Therefore, check if the value of position is relevant before setting in the setter.
Also, write a toString method to have a String representation of an AFLTeamMember as follows: “FirstName LastName, POSITION”. For example, “Simon Goodwin, COACH”.
2. AFLPlayer
You will implement a class AFLPlayer. This will be a child class of AFL Team Members. Each AFLPlayer, in addition to having a name and a position, will also have a number, and may or may not be a captain.
You will implement this class, including getter and setter methods as appropriate. However, for setting the value of the number, it is required to check if the number is a valid positive number.
The String representation of an AFLPlayer should be as follows “[Number] FirstName Last Name, POSITION”, followed by “(c)” if that player is a captain. For example, “[1] Adam Treloar, HF”, or “[11] Max Gawn, FOL (c)”.
3. AFLTeam
You will implement a class AFL Team. Each team has a name, a coach (which is an instance of AFLTeamMember), and a lineup consisting of 22 AFLPlayers.
You will implement this class, including getter and setter methods as appropriate. Also, write a toString method to get current value of all the attributes of this class.
4. AFLMatch
You will implement a class AFLMatch. An AFL match has two AFL teams, home team and away team, and the score attributes for each team. In an AFL match, each score can either be a goal worth 6 points, or a behind, worth 1 point. You will need to keep track of these separately, as in the number of homeGoals, the number of homeBehinds, the number of awayGoals, and the number of awayBehinds. This class will also contain main() method and another method to load the lineup . You will implement this class, including getter and setter methods as appropriate.
5. Load in the lineups
To load the lineups of the two teams, you will accept as input at the command line the names of two files. The first filename will be the name of a file the home team’s lineup, and the second filename will be the name of a file containing the away team’s lineup.
6. Run the game
You will use a loop to take input from the user, who is the “scorekeeper.” This loop will prompt the user to type one letter to indicate which team scored: “h” for the home team or “a” for the away team. It will then prompt the user to type one letter to indicate the type of score: “g” for goal or “b” for behind. This loop will keep running until the user types “f”, to indicate full-time (the end of the match). In action, the loop might look like this.
This CSE1OOF – IT and Computer Science has been solved by our PHD Experts at My Uni Paper.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.