Diploma in Information Technology
Programming Fundamentals
CA3 Group Assignment
January 2023 Semester
Submission Date: 12 February 2024, 11.59 a.m.
Continuous Assessment 3 Group Assignment (40%)
The Java application constitutes 30% of your overall grade, while the class
presentation is another 10%. Total marks for this assessment is 100 marks.
Project Task:
To enhance the experience of zoo enthusiasts, you are required to develop a
command line application using any Java IDE. This application should simulate the
management of a virtual zoo, including handling animals, enclosures, and
zookeepers. The Java application constitutes 30% of your overall grade, while the
class presentation is another 10%. The total marks for this assessment are 100
marks.
Project Requirement
With what you have learned from the module, you are task to develop the Java
application with the following:
1. You are required to write FOUR (4) Java classes.
a. Zoo
b. Animal
c. Enclosure
d. ZooManagement (Main Class)
More information about these Java classes will be on the next section of this
document.
2. Implement Error Handling methods on relevant functions.
Your program should handle errors effectively, ensuring the program only
terminates when the user chooses to exit, rather than due to unhandled
exceptions or runtime errors.
Class Descriptions
For each of the FOUR (4) Java classes listed above, you are to refer to their UML
class diagrams below, as well as their field and method descriptors, to determine a
way to code them. For each class, you are also to:
Define appropriate constructor(s) for them.
Define all needed getter and setter functions for them.
Note: All fields and methods listed in the UML class diagrams are COMPULSORY.
You can add any number of fields and methods that you need to help you implement
the class.
Zoo
- name : String
- description : String
- enclosures : ArrayList
+ <
enclosures : ArrayList
+ getTotalEnclosureArea() : int
+ countEnclosures() : int
Field Descriptors
name: Name of the Zoo.
description: Description of the Zoo.
enclosures: A list of all the enclosures in the Zoo.
Method Descriptors
getTotalEnclosureArea(): Counts the total area across all enclosures inside
the enclosures ArrayList.
countEnclosures(): Counts the total number of Enclosures in the enclosures
ArrayList.
Enclosure
- name : String
- area : int
- animals : ArrayList
+ <
ArrayList
+ countAnimals() : int
+ getUtilisedArea() : int
+ getUtilisedAreaPercentage() : double
+ countSpecies() : int
+ addAnimal( animal : Animal ) : bool
Field Descriptors
name: Name of the enclosure.
area: Number of units of space in the enclosure. Determines how many
animals can be stored in the enclosure. See areaNeeded in Animal for more
information.
animals: List of animals in this enclosure.
Method Descriptors
countAnimals(): Counts the total number of animals inside the animals
ArrayList.
getUtilisedArea(): Gets the total units of space that the animals in the
enclosure are taking up.
getUtilisedAreaPercentage(): Returns a value between 0 to 1. For example, if
75% of the available area is used by animals, this will return 0.75.
countSpecies(): Counts the number of unique species in this enclosure.
Returns the number of unique species in this enclosure.
addAnimal(): Adds an animal to the animals ArrayList if there is enough
space. Returns true if successful. Otherwise returns false.
Animal
- species : String
- enclosure : Enclosure
- areaNeeded : int
+ <
areaNeeded : int)
+ hasCompanion() : bool
Field Descriptors
species: The species of this Animal.
enclosure: The Enclosure that this Animal belongs to.
areaNeeded: The amount of area this Animal takes up. See area in Enclosure
for more information.
Method Descriptors
hasCompanion(): Does the animal have another companion of the same
species inside of its enclosure? Returns true if so, otherwise returns false.
ZooManagement
- zoos : ArrayList
+ main(args : String[])
+ manageZoos()
+ manageEnclosures()
+ manageAnimals()
In ZooManagement, you will be required to code the following functionalities:
1. Manage Zoos: This option will open a set of suboptions that allow the user
to...
a. Create new Zoos.
b. Delete existing Zoos.
c. Calculate and output the total area of all enclosures in the zoo.
d. Count and output the total number of enclosures.
2. Manage Enclosures: This option will open a set of suboptions that allow the
user to...
a. Add an Enclosure to a Zoo.
b. Delete an existing Enclosure from a Zoo.
c. Get the utilised area in a given enclosure.
d. Get the percentage of utilised area in a given enclosure.
e. Count the number of species in an enclosure.
3. Manage Animals: This option will open a set of suboptions that allow the user
to...
a. Add animals to an enclosure.
b. Remove animals from an enclosure.
c. Check if an animal has a companion in its enclosure.
Note: The user will be able to continuously select commands from ZooManagement
until they choose to exit the program.
Documentation
On top of the Java Application development, you will also be required to submit a
report with the following documentation:
A short reflection on this assignment with the following pointers:
1. Things you have learnt through doing the assignments
2. Screenshot and explanation on unresolved/unachievable requirements.
Assessment Topics
Topics 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
Submission Instructions
You are required to put the following files into a ZIP folder for submission:
1. All Java class files required to run the program (other project files are NOT
required).
2. Your assignment report
The ZIP folder should be named in the following format:
[GROUP NAME]_ SIM_PF_CA3.
In the assignment report, students are also required to clearly state the name
and student ID of every student in the group. Students should keep a copy of
assignment submitted.
The assignment must be submitted BY 11.59 a.m. on 12 February 2024.
Penalty for Late Submission of Assignment
By one day: 20% to be deducted from total marks.
More than one day: Submission will NOT be graded.
A marking rubric for this assignment can be found in the appendix of this
assignment.
Important Dates of CA3 Assignment
CA3 Group Assignment Deadline: 11.59 a.m. on 12 February 2024
Zip all assignment files. Submit your assignment via Canvas. All assignment files
must be submitted in order to be graded.
Lecturer Contact
You should contact your lecturer via your SIM email whenever you encounter any
issue or have questions about your project. You may send your email to:
[email protected]
Appendix
Marks Breakdown
S/N Requirement Marks
Java Project (100 marks)
1 Zoo Java Class 20 marks
2 Enclosure Java Class 20 marks
3 Animal Java Class 20 marks
4 ZooManagement Java Class 20 marks
5 Program Error Handling 10 marks
6 Reflection 10 marks
Sample Output
Zoo Management System
1. Manage Zoos
2. Manage Enclosures
3. Manage Animals
4. Exit
Enter your choice: 1
Zoo Management - Manage Zoos
1. Create new Zoo
2. Delete existing Zoo
3. Calculate total area of all enclosures in the zoo
4. Count total number of enclosures
5. Back to main menu
Enter your choice: 1
Enter Zoo details:
Name: National Zoo
Description: A large zoo with a variety of animals.
Zoo created successfully!
Zoo Management - Manage Zoos
1. Create new Zoo
2. Delete existing Zoo
3. Calculate total area of all enclosures in the zoo
4. Count total number of enclosures
5. Back to main menu
Enter your choice: 3
Total area of all enclosures in the zoo: 1200 square units
Zoo Management System
1. Manage Zoos
2. Manage Enclosures
3. Manage Animals
4. Exit
Enter your choice: 2
Zoo Management - Manage Enclosures
1. Add an Enclosure to a Zoo
2. Delete an existing Enclosure from a Zoo
3. Get utilised area in a given enclosure
4. Get percentage of utilised area in a given enclosure
5. Count number of species in an enclosure
6. Back to main menu
Enter your choice: 1
Enter Enclosure details:
Name: Lion Enclosure
Area: 500
Select a Zoo to add the enclosure:
1. National Zoo
Enclosure added successfully!
Zoo Management - Manage Enclosures
1. Add an Enclosure to a Zoo
2. Delete an existing Enclosure from a Zoo
3. Get utilised area in a given enclosure
4. Get percentage of utilised area in a given enclosure
5. Count number of species in an enclosure
6. Back to main menu
Enter your choice: 3
Enter the name of the enclosure: Lion Enclosure
Utilised area in Lion Enclosure: 0 square units
Zoo Management System
1. Manage Zoos
2. Manage Enclosures
3. Manage Animals
4. Exit
Enter your choice: 4
Exiting Zoo Management System. Goodbye!
Below is a sample output of the program that you need to build. It does NOT include output for all the functions that you are required to
build, so you will need to decide how to fulfill the outputs for those functionalities in your project.
You need not follow the sample output word for word. Feel free to improve upon the text output or interface if you wish.Welcome to the Zoo Management System!
WX:codehelp