TM, 2025
Assignment 1 (worth 15% of unit assessment)
Due Date: Midnight, Saturday – 21 June 2025
All Students: Submit the Assignment via LMS by the due date.
Late penalty: 10% per day penalty for delayed submissions unless prior extension of deadline is
obtained from the unit coordinator.
You should keep a copy of your work.
You may be asked by your tutor to explain your submission. Make sure you understand everything
you are submitting.
We are aware of websites providing code/solution for assignments, if you use those services, you
will be reported for Academic Misconduct.
If Test Tables are not submitted, the assignment will not be marked and receive a 0 mark.
References and Pre-requisites:
You will need to familiarise yourself with materials covered in Topics 1 to 6.
Lab Practices 1 to 5 have been attempted, even if not submitted.
Textbook Chapters 1 to 7
If you are unsure of anything about the assignment question, you need to get clarification early.
Read this document very carefully.
OBJECTIVES:
Apply the Object-Oriented design paradigm to construct solutions in a modular way.
Implement important concepts of information hiding and encapsulation.
Implement the design using the JAVA programming language.
Demonstrate working knowledge of the array data structure.
Demonstrate searching in the array of class objects.
Worth:
This assignment is worth 15% of the total assessment for the unit.
This is an individual assignment and must be completed by you alone.
Any unauthorised collaboration/collusion and plagiarism may be subject
to investigation and result in penalties if found to be in breach of
University policy.
, Question
This question reinforces concepts from Lab Practices 1 - 5. Best practice of Class and Method design
should be demonstrated. This will require a good understanding of class design concepts and method
design concepts with some fundamental design principles: modularisation, code re-use, high
cohesion and low coupling.
Before attempting this question, complete the pre-requisites listed on the first page of this document.
Assignment 1 uses O-O design implemented in Java. You will need to use a user-defined class, as
an array of such class objects will be required. You should explain how you implement this
assignment by addressing the following O-O concepts in your external documentation: (Note: not
just by providing definition only, but highlight exactly where in the code you are implementing
these concepts). Copy and paste code from your program to show how you implemented the
following in your program using your external documentation. You should use your code to
explain the concepts below. Some of the concepts could be related and you will need to explain
how they are related.
Open/Closed Principle
Information hiding
Encapsulation
Modularisation
Private variables
Low coupling
Assessors and Mutators
Helper
User-defined Class:
You will design and implement your own data class. As the data stored relates to monetary change,
the class should be named ChangeC. The class requires at least 2 instance variables for the name of
a person and the coin change amount to be given to that person. In New Zealand, the coins
denominations are NZ$0.10, NZ$0.20, NZ$0.50, NZ$1, and NZ$2. You can use 5 instance variables
to represent amounts for each of the 5 coin denominations. There should be no need for more than
these instance variables. However, if you use a different way to implement this, you must provide
legitimate justification for their usage in the internal and external documentation. All these instance
variables should be declared as private. Think of a way such that the client program can use the
same class name and public methods for other countries with different coin denominations without
changing their client program. The key point here is to work on a design such that there is no need
for the client class to make any change when the ChangeC class needs to upgrade to accommodate
the different coin denominations for different countries. Explain how your class can satisfy this in
your external documentation and what concepts are used to implement this design.
Your class will need to have at least a default constructor, and a constructor with two parameters:
one parameter being a name and the other a coin amount. Your class should also provide appropriate
get and set methods for client usage. Other methods (including helper) may be provided as needed.
However, make sure they are necessary for good class design; you must provide legitimate
justification for their usage in the internal and external documentation. In particular, your class
should NOT include Input and Output methods. The only way to get data out of a data class object