Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

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<Enclosure>

+ <<constructor>> Zoo(name : String, description : String, enclosures : ArrayList<Enclosure>)

+ 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<Animal>

+ <<constructor>> Enclosure(name : String, area : int, animals : ArrayList<Animal> )

+ 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

+ <<constructor>> Animal(species : String, enclosure : Enclosure, 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<Zoo>

+ 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]