individual assignment

F21SF / F20SF Assignment 2 2022-23
F21SF / F20SF Assignment 2
weight 60% individual assignment
Deadline: Monday 5 December 2022 at 15:30 local time
Gives practce in: Inheritance; GUI; UML – Use cases, actvity diagram, class diagram; reflecton on
challenges encountered and (F21SF only) language design and features.
1 Introduction
This assignment builds on your applicaton, produced in Assignment 1, which holds a list of compettors.
You should work on this assignment individually; this is not a group assignment.
Read this document carefully and follow the instructons. Do not assume that this assignment is identcal to
any assignment you may have seen in the past. If you have any questons, contact your lecturer in good
You should develop your program using
incremental development:
Develop your program a litle bit at a tme and keep testng it.
Save a working version before making the next set of alteratons.
If you use GitLab, make sure your project is set to “private”, so that only you can view it.
If you run out of tme, submit a working program which provides some of the functonality. You will
get very few marks for handing in lots of code that does not run correctly.
As always, your code must be well-designed, well-laid out and well-commented – and if it isn’t you may
lose marks.
Read this document several tmes before startng work, to ensure that you understand what is involved.
2 Conditions for this coursework
The course applies the university’s submission of coursework policy:
• No individual extension for coursework submissions.
• Deducton of 30% from the mark awarded for up to 5 days late submission.
• Submission more than 5 days late will not get a mark.
• If you have mitgatng circumstances for an extension, talk to your programme director and submit
an MC form with supportng documentaton to the School’s Ofce.
3 Sequence overview

From week 7 – Stage One
From week 8 – Stage Two
From week 9 – Stage Three
From week 10 – Final stage
– draw UML diagrams
– use inheritance, list of compettors
– add GUI
– add program reports. Write overall report.

Page 1 of 6
F21SF / F20SF Assignment 2 2022-23
4 Stage One – UML Use case Diagram, Text description and Activity Diagram
You can draw these diagrams using a UML tool, a drawing package, or by hand.
The details in the paragraph below is ONLY for the use case diagram – the applicaton that you are asked to
write is a litle different, and should be simpler. For example, in your applicaton, the compettor details
and scores are loaded from a text fle (to save tme!) but in this descripton, they are entered in a GUI.
Draw a Use Case Diagram for the requirements in the following paragraph, and write a detailed descripton
for the ‘registraton’ use case – this is the numbered ideal scenario with alternatves. Also draw an actvity
diagram for the ‘registraton’ use case. There are probably several equally correct interpretatons of these
requirements so don’t worry if you don’t all have identcal diagrams.
A system is required to keep details of a competition, which has various categories for competitors.
Before the competition, competitors register by filling in their details using an online form.
On the day of the competition, competitors are awarded scores for their performance. These scores are
typed into the system by a member of staff, who first searches for the competitor using their number.
When all the people in a given category have competed, a staff member requests details of the results.
After the competition is over, competitors and staff can search for a particular competitor using their
number, and view their details, including the basic and overall scores. They can also print out various
summary reports.
Here is a bit more detail about the registration process. Competitors enter their name, email, date of
birth, category and level, and are supplied with a unique competitor number. If any fields are omitted,
an error message is displayed and the competitor is asked to resubmit the form. If a competitor already
exists with the same email address and the same category, the registration is refused. If a competitor
already exists with the same email address and for a different category, their registration is accepted
and they are allocated a different competitor number for this category. If a competitor’s age is
incompatible with the level, the competitor is offered the opportunity to resubmit the form for a different
level. If everything is OK, the competitor is allocated a competitor number and the registration is
Page 2 of 6
F21SF / F20SF Assignment 2 2022-23
5 Stage Two – Using Inheritance – after three inheritance lectures
Note: You are NOT required to develop a complete competton system as described in the Use Case secton
above. Just do what is specifed below:
1 Competitor classes
Recall that you created a ‘compettor’ class in the Assignment 1.
Now create two additonal ‘compettor’ classes (making three types of compettor in total), making
different design choices (you might like to consider different types of compettons, but this is not
compulsory so long as there are signifcant differences in design). These classes should be different
in some parts and be similar in others. Try to get some decent variaton so that you can interestingly …
… look at your three classes and identfy:
1) Which instance variables and methods are identcal.
a) The level is considered identcal in two classes if they are both Strings, or both integers,
even if the data has different values.
b) The compettor number should be a common atribute in the superclass. Renumber some
of the compettors in each original data if necessary, to get a set of unique numbers.
2) Which instance variables and methods have the same signature but a different body.
E.g. the
getOverallScore method will have identcal signatures (method name, return type),
but probably different method bodies in each one of the ‘compettor’ classes. This method will
become an abstract method in the superclass, and the full details of the method will be provided in the subclass.
3) Which instance variables and methods are only in one specifc compettor class.
Now create a general
Competitor class which is a superclass containing common instance variables and methods (1 above), and abstract method signatures for methods with the same signature and different bodies (2 above).
Each ‘compettor’ class of the three ones that you have created now becomes a subclass which extends the
Competitor super class. You’ll need to remove all the instance variables and methods
which are fully declared in the superclass.
2 CompetitorList class
Adapt your CompettorList class so that the ArrayList can contain all Competitor objects.
You can stll read in the data from separate text fles, one for each subclass. For this assignment, you can
assume that your text fles contain correct data – you don’t need to do any checking.
Check that your methods stll make sense (the getFullDetails probably won’t look right, but leave that for
3 Competitor Report
Your program should create a compettor report in a text fle consistng of:
1) A table of all compettors consistng of short details only. Order is not important.
2) Details of the compettor with the highest overall score (taken from ALL the compettors).
Page 3 of 6
F21SF / F20SF Assignment 2 2022-23
6 Stage Three – Using a GUI – Do this after the lectures on GUIs.
Create a GUI secton to enable a user to interact with the list of compettors. The GUI can be one window
containing three separate panels, or three separate windows. You may also have to add methods to your
other classes.
Your GUI must alter the data that’s held in the program – it’s not necessary to update the text fles. Provide
useful functonality which must include:
View and alter the scores for one compettor and see immediately the overall score.
View table of compettors sorted in on of at least three different ways.
Be careful with this one, if you change the original ArrayList order and leave it in a different order, it
might affect other methods.
View details for compettors as sorted in one of the ways above and in additon fltered in one of at
least three different ways (i.e. viewing only for those compettors in a partcular subclass or with
certain atributes, such as level, category, or your chosen atribute).
View full or short details for a compettor, given a compettor number
Mostly you should use the components introduced in the lectures, but you might like to fnd out how to use
one or two other components (e.g. radio butons for the search). You won’t get full marks for just copying
lecture GUIs with minimal alteratons.
Learn the basics of GUIs in java and design your GUI from frst principles: Don’t use a drag and drop IDE to
help with the GUI! The drag and drop features usually introduce a lot of complex code, so although your
GUI might look nice, it will be harder for you to alter and document.
First you could write the GUI layout only and just check that this looks good. Then combine the GUI with the
list of compettors.
Your GUIs should be opened by the manager class. You can use one GUI if you like, but if you use a separate
window for each GUI, make sure to adjust the locaton of each window so that when you open them
together you can see all of them.
There should be a Close buton which writes the compettor report to a text fle and then closes the
7 Report
Write a pdf report – try to be short but comprehensive: longer is not beter, more informatve is beter,
which is not quite the same thing – which should contain:
1) A
technical secton which explains your program code, discussing
a) the scoring methods and class/method abstracton design choices used in the three compettor
subclasses and compettor superclass, and
b) providing technical details of the features implemented in your GUI, aimed at a reader who has
studied the material in this course but has not done the coursework.
Start from a user acton (e.g. click buton or enter locaton id to request locaton details), and go
through the method calls untl the result is achieved (e.g. data displayed in text area). Use
appropriate UML diagrams, code fragments and screenshots.
2) Diagrams:
a) The use case diagram and textual descripton.
b) A clear and informatve actvity diagram.
c) A clear and informatve class diagram, which must include types of variables and whether they are
public, private, or protected. You can show an overview and give details separately if this is
Briefly (e.g. 2 paragraphs) outline two of the main challenges involved in learning object-oriented
programming, based on your own learning, demonstratng two reflectve insights into your own
learning process.
Page 4 of 6
F21SF / F20SF Assignment 2 2022-23
4) A status secton: Does your program meets the specifcaton fully, or is it incomplete? This can be very
brief (don’t provide a list of everything that you were asked to do – the marker knows this).
“This applicaton meets the specifcaton fully”
“The applicaton does everything except that sortng in descending order of overall score
doesn’t show all the compettors”
Include the following lists and tables; you are NOT required to submit a table of tests done for this
If necessary: a list of known bugs and a list of unimplemented (or partally implemented)
A table showing what user input errors your applicaton can handle, and which it can’t. In
the table below, these examples show one user mistake that is handled and one that is not.
They are just examples – ideally your program should not crash for non-numeric data.

Compettor number entered in GUI which
does not correspond to any in the list
Error message is displayed
Non-numeric data entered in GUI for the
compettor number
Not handled, program will crash

8 Short research essay (F21SF only)
F21SF only:
Write a short (1-2 pages max A4 single spaced text) essay evaluatng Java as a programming language,
commentng briefly but cogently on its history, present uses, and future prospects.
For full marks your essay must consider the language in
all of the following:
1) in its technical context – the design of the language itself – and
2) in its social, economic, and commercial context – what the language actually means as a tool for
ataining modern functonal and business goals within practcal sofware engineering – and
3) how the technical and commercial contexts interact.
Note that a mere list of facts may not necessarily score full marks. Your marker is looking for evidence of
thoughtul and informed reflecton on what the Java programming language is, and its benefts and
challenges in the context of modern programming language design and applicaton.
Page 5 of 6
F21SF / F20SF Assignment 2 2022-23
9 How to submit
Please upload precisely one zip fle called
“[username]” (example: “”) or
“[username]” (example: “”)
1) Your pdf report.
2) (F21SF only) Your short research essay if applicable (see Secton 8 above).
3) Your source and input fles in a single directory in a format that can be compiled easily.
Some basic ‘do’s and ‘do not’s:
1) Do not use rar (use zip instead). Do not nest zip fles (i.e. do not submit a zip fle that contains other zip
Do not include bytecode .class or .jar fles. Do not use additonal libraries that your lecturer may
not have (if in doubt, ask in good tme).
Do use the approved naming conventon (e.g. Do include course code “F21SF” or
“F20SF”, assignment name “Assignment 2”, your name, and your user ID in every fle you submit
(including the pdf report and your code directory) — it is in your own interests to ensure that your
submission can’t get mixed up.
The lecturers will view the source, and compile and run your applicaton.
The lecturers reserve the right to
not mark code that will not compile.
The marking scheme and marking sheet for this assignment are on the Canvas course page at
10 Demonstration
You will be required to deliver a brief 5-minute demonstraton of your applicaton, as follows:
1) A brief introducton to your program and the choices you have made
2) Demonstraton of the functonality of the program, including:
a) GUI functonality, and
b) output fle (Compettor Report).
3) Demonstraton of any errors, and how you tested for them.
You do not need to submit any slides, but you can prepare some for use during the demonstraton if you
think this would.
You will not get marks directly for the demonstraton, however, your performance may help your marker to
more accurately reflect on your understanding in your submission.
Page 6 of 6