- 首页 >> Database作业
CSC8406 2020/2021: Object Oriented Programming
Module Coursework
Improve knowledge and experience of applying Object Oriented Design and Implementation
techniques to solving problems using the JAVA programming language, specifically with the
aim of gaining experience in the following:
• Programs, programming and programming environments.
• Object-oriented programming: comments; types; variable declarations; arithmetic
and Boolean expressions; assignment.
• Loops and conditions; input and output.
• Data structures: arrays and lists.
• Simple algorithms: searching, sorting.
• Methods.
• Objects; inheritance; applications.
Assessment (Deadline: 14:00, Friday, 13 November 2020)
This coursework carries 100% of the total mark for the module. It is marked out of a total of
100. You are required to submit the following:
• Part 1 Source Code (75%): The main emphasis is on proficiency in Object Oriented
Programming using Java, including: definition of classes (fields, constructors,
methods), inheritance, exception handling, as well as appropriate use of APIs such as
collections. One of the classes of your application should include a static method
called main containing the evidence that you tested your program.
• Part 2 Testing (5%): The main emphasis is on the appropriate choices for test cases.
• Part 3 Documentation (20%): This includes appropriate Java Docs, and a wellstructured
project report (PDF, or Word document). The project report should
include your reasoning behind your design (include also a class diagram). The project
report should describe implementation details and include a discussion of test cases.
The project report should also include instructions on how to run your program.
Students aiming for 1st class marks are expected to widen their knowledge beyond the
content of lecture notes through background reading.
The University has strict policies for penalising plagiarism, and all work submitted for
assessment must be your own work. This does not prohibit discussion among students
about coursework. Indeed, such discussion to increase understanding is positively
encouraged. However, the answers submitted must be your original contribution, written
and designed by you. It is permissible to include some material drawn directly from other
sources (if you think this benefits the report part of the submission), but such non-original
material must be explicitly declared to be a quotation from an external source, and that
source must be listed.
Scenario: Sports League
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).
Submit all your files including documentation and source code within a properly structured
zip folder. Submission must be done electronically through NESS.
Deadline: 14:00 on Friday 13 November 2020