logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
George BlackbridgeeCriminology
(5/5)

839 Answers

Hire Me
expert
Liam PattersonEnglish
(5/5)

953 Answers

Hire Me
expert
Deanna BradfordResume writing
(5/5)

548 Answers

Hire Me
expert
Norman RoxManagement
(4/5)

577 Answers

Hire Me
Others
(5/5)

This scenario covers sports leagues where teams of players compete against each other, such as in football.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

This scenario covers sports leagues where teams of players compete against each other, such as in football.

A league (e.g. English Premier League) consists of a fixed number of clubs. Throughout a season of the league each club plays each other club and the result is recorded. Each club is awarded points for each match depending on the result, e.g. in football you get three points for winning, one for drawing and none for losing. At the end of the season the club with the most points wins the league. If two clubs have the same number of points, they are ranked by goal difference, which is the total number of goals they have scored minus the total number of goals they have conceded.

Each club (e.g. Newcastle United) has a squad of players, the size of which may vary from club to club. For each match that the club plays a team is selected from the squad. The team is always of a fixed size e.g. eleven in football.

Each player (e.g. Leon Best) has a date of birth and a height, and plays for one club. At the end of a league season, the player who has scored the most goals (i.e. has the largest goal tally) wins the Golden Boot trophy.

 

Define a Java class to represent players. Provide methods to:

create a player;

set and get the name, date of birth and height of the player;

add to the goal tally of a player;

get the goal tally of a player.

 

Define a Java class to represent clubs. Provide methods to:

create a club;

set and get the name of the club;

add to the goals-scored tally of the club;

add to the goals-conceded tally of the club;

get the goal difference of the club;

add to the points tally of the club;

get the points tally of the club;

add a player to the squad of the club;

 

find out whether a player is in the club's squad;

find the average age of the squad;

find the average height of the squad.

 

Define a Java class to represent matches. Provide methods to:

create a match;

set and get the time and place of the match;

set and get the clubs playing in the match;

record which players played and how many goals each player scored;

get the final score (e.g. Sunderland 0 – 1 Newcastle United);

get the final result (e.g. Newcastle win).

 

Define a Java class to represent leagues. Provide methods to:

create a league;

set and get the name of the league;

add a club to the league;

add a fixture to the league (i.e. a match yet to be played);

record a result in the league (i.e. add details to a match once it has been played);

find the top team in the league;

print out a league table;

find the top scorer (Golden Boot) in the league.

 

Extend your program in the following ways:

1. Provide robust error checking, e.g. if a player is listed as scoring in a match, then they must be in the squad of one of the clubs. Also, each player must be in only one squad for each league.

2. Define a special type of player, the goalkeeper.

3. Find the best goalkeeper in the league. At the end of the season the best goalkeeper is the one who has the most clean-sheets (i.e. matches in which the team concedes no goals).

 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme