Question: CPSC 6 1 1 9 Object Oriented Development Section 0 1 & V 0 1 , Fall 2 0 2 4 Assignment 2 : UML

CPSC 6119 Object Oriented Development Section 01 & V01, Fall 2024
Assignment 2: UML/Java OO System Design and Development
Points: 80
This introductory assignment is intended to be done by you as a solo effort. The goal of the is to prepare you to perform ?OO design and development tasks with UML and Java. The design and code you develop here will be used as the starting point for implementing patterns and enhancements in assignments 3 and 4 as well. You should use a Java 8 or later environment to develop this code (I recommend Java 17).
Overall Assignment - Zoo Simulation
We will simulate a zoo in this assignment, focusing on animals and zoo staff members. The Zoo contains a variety of Animals. Three families of animals are provided for you. You should add a fourth of your choosing. In your solution to modeling the Zoo, you should represent the Animals in a class inheritance hierarchy as follows (Animal - Family - Type):
Animal
Pachyderm
Rhino, Elephant, Hippo
Feline
Tiger, Lion, Cheetah
Birds
Parrot, Falcon, Owl
[Custom Animal Family you select]
[Three Animal Types you select]
An Animal has attributes including Name (a string), Size (an enumerated value - small, medium, large, extralarge), and Healthy (a boolean). Animals have methods including sleep, roam, eat, makeSound.
Each method when called should issue a print statement saying the action has been taken by the specific instance of the animal, for instance:
Tammy the Tiger has gone to sleep.
Rita the Rhino is roaming - and charged!
Cory the Cheetah is eating 0 food units.
sleep is a common method to all the animals.
roam varies at the family level.
Pachyderms may charge during a roam (25% of the time).
Felines may sleep instead of roaming (50% of the time).
eat is common to all animals. There is a 10% chance an animal eats no food when fed, and a 10% chance they eat too much.
makeSound is unique to each type of animal.
The Zoo is made up of Enclosures and a Hospital. There is an Enclosure for each Type of Animal. Enclosures are
Page 1
named for the Type of Animal kept in them. Animals are assigned to an Enclosure if Healthy or to the Hospital if not Healthy. You will need to create appropriate associations to relate Enclosures and the Hospital to the Zoo, and Animals to Enclosures (by Type) or the Hospital.
The Zoo also has Staff. Currently there are two subclasses of Staff, Handlers and Veterinarians. The Zoo will have a Handler assigned to each Family of Animals, and a single Veterinarian assigned to the Hospital.
The Zoo simulation will run for 30 days. There are three unique instances of each Animal Type in all the Enclosures at the beginning of the simulation (and no Animals in the Hospital). Display the start and end of each numbered day in the console.
2:31
65
OOD Assignment 2.pdf
named for the Type of Animal kept in them. Animals are assigned to an Enclosure if Healthy or to the Hospital if not Healthy. You will need to create appropriate associations to relate Enclosures and the Hospital to the Zoo, and Animals to Enclosures (by Type) or the Hospital.
The Zoo also has Staff. Currently there are two subclasses of Staff, Handlers and Veterinarians. The Zoo will have a Handler assigned to each Family of Animals, and a single Veterinarian assigned to the Hospital.
The Zoo simulation will run for 30 days. There are three unique instances of each Animal Type in all the Enclosures at the beginning of the simulation (and no Animals in the Hospital). Display the start and end of each numbered day in the console.
In a given day, the Staff will perform the following actions.
wakeAnimals - Each Handler will wake their assigned Animals - when awakened, Animals will makeSound.
feedAnimals - Each Handler will feed their assigned Animals - each Animal will perform an eat action. If an Animal does not eat or eats too much, there is a 50% chance of becoming not Healthy. If the Animal is not Healthy it is moved from the Enclosure to the Hospital (this should be announced).
zooStatus - At this point the Zoo opens for the day, you should display a tabular list of the individual Animals in each Enclosure along with the name of the Handler and a list of individual Animals in the Hospital along with the name of the Veterinarian.
exerciseAnimals - Each Handler will exercise their assigned Animals - each Animal will perform a roam action.
treatAnimals - The Veterinarian will treat sick Animals. Each Animal in the hospital will have a 50% chance of becoming Healthy. If they become Healthy, they will be moved to their normal enclosure.
bedAnimals - Each Handler will bed down their Animals for the evening - each Animal will perform a sleep action.
When Staff or Animals perform actions, the appropriate print statements should be sent to the console. For Staff, this may look like:
Felix
CPSC 6 1 1 9 Object Oriented Development Section

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!