SlideShare a Scribd company logo
1 of 2
Download to read offline
Task: Implement the 12 classes, 5 enums, and one interface shown in the diagram above and
then answer the questions at the end of the document.
Class Design:
Zoo A zoo contains a collection of animals.
Animal An animal is a living creature. Each animal has a name, species, & weight. An animal may
be able to fly, swim, or walk. An animal can breathe either through lungs or through gills. A mother
animal can deliver babies either though laying eggs or through live birth. Animals are either cold or
warm blooded. Their skin may be covered with fur. Animal in this project is an interface.
AbstractAnimal An abstract class to implement the Animal interface. An abstract class cannot be
instantiated. Many of the methods are defined as abstract, leaving it for one of the eight
subclasses to define.
Bird, Amphibian, Mammal, Reptile, Fish, FlightlessBird, SwimmingMammal, DuckBilledPlatypus
subclasses of AbstractAnimal, any of which can be instantiated into an object. Defines the
methods left as abstract in AbstractAnimal. All of these subclasses have a similar argument
signature.
AnimalFactory a class with a single static method, getInstance(), which, depending on the species
of the animal, will create the appropriate subclass of AbstractAnimal. You are not meant to create
Animals using the constructors for the subclasses of Abstract.
Depending on the species of the animal. There are two ways to do this:
1. Use a giant if block to examine the animals species and return an object of the correct subtype
of AbstractAnimal, or
2. Implement a hash map where the key is the animal species, and the value is an object of the
appropriate subtype of AbstractAnimal. Use the map get() method to return the subtype of Animal
given the species of the animal.
ZooKeeper The zookeeper admits animals into the zoo and keeps track of the animals in it. It is
the only class in this project with a main() method, and the only method in this class is main.
Tasks:
1. Build the 5 enumerations:
a. Birth,
b. BloodTemp,
c. Movement,
d. Respiration,
e. Skin Covering
2. Implement the Animal interface, the AbstractAnimal class and all the subclasses of
AbstractAnimal. Put these classes in the package edu.bergen.zoo
3. Implement the AnimalFactory class. Its getInstance() method should return one of:
a. Bird
b. Mammal
c. Reptile
d. Amphibian
e. Fish
f. FlightlessBird
g. SwimmingMammal,
h. DuckBilledPlatypus
based on the value of species provided in the argument list.
Hint#1 Use an if block, checking on the value of species, and return an object of the appropriate
subclass of AbstractAnimal, or
Hint#2 = create a HashMap, where the key is the name of the species, and the value is an object
of the appropriate subclass of AbstractAnimal
4. Implement the Zoo class. Put this class in the package edu.zoo
5. Build a ZooKeeper class. In its main() method, do the following tasks:
a. Construct a Zoo object.
b. Create the following ten Animals using AnimalFactory.getInstance(), and use the
Zoo.addAnimal() method in put them in the Zoo. The ten animals are:
i. Eli the Elephant (3000 lbs)
ii. Betty the Boa (20 lbs)
iii. Katerina the Kangeroo (600 lbs)
iv. Voldomir the Vampire (10 lbs)
v. Oksana the Ostrich (300 lbs)
vi. Sophia the Salamander (2 lbs)
vii. Gianluca the Giraffe (800 lbs)
viii. Lisa the Lion (700 lbs)
ix. Samuel the Shark (300 lbs)
x. Harry the Hawk (10 lbs)
c. Print the name and species of all the animals in the zoo that lay eggs.
d. Print the name and species of all the animals in the zoo that are cold blooded
e. Print the name and species of all the animals in the zoo that breathe through their gills
f. Print the name and species of all the animals in the zoo that lay eggs.
g. Print the toString() for the animal named Lisa
h. How many animals are in the zoo?

More Related Content

Similar to Task Implement the 12 classes 5 enums and one interface s.pdf

Classification prt1
Classification prt1Classification prt1
Classification prt1Allyse Fritz
 
Classification
ClassificationClassification
Classificationsmsknight
 
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....JhoverLeeSuniga1
 
Chapter 1 section 4 (how are living things classified) 2011
Chapter 1 section 4 (how are living things classified) 2011Chapter 1 section 4 (how are living things classified) 2011
Chapter 1 section 4 (how are living things classified) 2011Mr. Motuk
 
2nd qtr 8 characteristics of each group of vertebrates
2nd qtr 8 characteristics of each group of vertebrates2nd qtr 8 characteristics of each group of vertebrates
2nd qtr 8 characteristics of each group of vertebratesShirley Sison
 
Supo gr2 science_activities1
Supo gr2 science_activities1Supo gr2 science_activities1
Supo gr2 science_activities1Diego Mora
 
ANIMALS WITH BACKBONES.pptx
ANIMALS WITH BACKBONES.pptxANIMALS WITH BACKBONES.pptx
ANIMALS WITH BACKBONES.pptxBryanBangiban1
 
Classification prt1
Classification prt1Classification prt1
Classification prt1jdrinks
 
Animal dichotomous key
Animal dichotomous keyAnimal dichotomous key
Animal dichotomous keyalbenestra
 
Application Animal Characteristics In today’.docx
           Application Animal Characteristics In today’.docx           Application Animal Characteristics In today’.docx
Application Animal Characteristics In today’.docxhallettfaustina
 
Mammals, birds and fish are amazing!!!
Mammals, birds and fish are amazing!!!Mammals, birds and fish are amazing!!!
Mammals, birds and fish are amazing!!!agullaesca
 
Science Quarter 2 Week 3.pptx
Science  Quarter 2 Week 3.pptxScience  Quarter 2 Week 3.pptx
Science Quarter 2 Week 3.pptxMarielSayao1
 
Webquest
WebquestWebquest
Webquestdkw9
 
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...MariaTheresaDemeteri
 
ECOSYSTEMS_ FLOW OF ENERGY
ECOSYSTEMS_ FLOW OF ENERGYECOSYSTEMS_ FLOW OF ENERGY
ECOSYSTEMS_ FLOW OF ENERGYPatriciaComaling
 

Similar to Task Implement the 12 classes 5 enums and one interface s.pdf (20)

SCIENCE 4_Q2_Mod2.pdf
SCIENCE 4_Q2_Mod2.pdfSCIENCE 4_Q2_Mod2.pdf
SCIENCE 4_Q2_Mod2.pdf
 
Classification prt1
Classification prt1Classification prt1
Classification prt1
 
Classification
ClassificationClassification
Classification
 
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....
Q2-Week2- Body Structures of Amimals that Help them Adapt and Survive - Copy....
 
Chapter 1 section 4 (how are living things classified) 2011
Chapter 1 section 4 (how are living things classified) 2011Chapter 1 section 4 (how are living things classified) 2011
Chapter 1 section 4 (how are living things classified) 2011
 
2nd qtr 8 characteristics of each group of vertebrates
2nd qtr 8 characteristics of each group of vertebrates2nd qtr 8 characteristics of each group of vertebrates
2nd qtr 8 characteristics of each group of vertebrates
 
Taxonomy ppt
Taxonomy pptTaxonomy ppt
Taxonomy ppt
 
Supo gr2 science_activities1
Supo gr2 science_activities1Supo gr2 science_activities1
Supo gr2 science_activities1
 
ANIMALS WITH BACKBONES.pptx
ANIMALS WITH BACKBONES.pptxANIMALS WITH BACKBONES.pptx
ANIMALS WITH BACKBONES.pptx
 
Classification prt1
Classification prt1Classification prt1
Classification prt1
 
Animal dichotomous key
Animal dichotomous keyAnimal dichotomous key
Animal dichotomous key
 
Application Animal Characteristics In today’.docx
           Application Animal Characteristics In today’.docx           Application Animal Characteristics In today’.docx
Application Animal Characteristics In today’.docx
 
5.5 animals
5.5 animals5.5 animals
5.5 animals
 
Mammals, birds and fish are amazing!!!
Mammals, birds and fish are amazing!!!Mammals, birds and fish are amazing!!!
Mammals, birds and fish are amazing!!!
 
Science Quarter 2 Week 3.pptx
Science  Quarter 2 Week 3.pptxScience  Quarter 2 Week 3.pptx
Science Quarter 2 Week 3.pptx
 
Animal Adaptations
Animal AdaptationsAnimal Adaptations
Animal Adaptations
 
Webquest
WebquestWebquest
Webquest
 
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...
Science6 Q2_Lesson on Determine the Distinguishing Characteristics of Vertebr...
 
Arthropods evelyn
Arthropods evelynArthropods evelyn
Arthropods evelyn
 
ECOSYSTEMS_ FLOW OF ENERGY
ECOSYSTEMS_ FLOW OF ENERGYECOSYSTEMS_ FLOW OF ENERGY
ECOSYSTEMS_ FLOW OF ENERGY
 

More from acsmadurai

T X Projection of Di An Fo Isobaric diagr illustrating.pdf
T  X Projection of Di  An  Fo Isobaric diagr illustrating.pdfT  X Projection of Di  An  Fo Isobaric diagr illustrating.pdf
T X Projection of Di An Fo Isobaric diagr illustrating.pdfacsmadurai
 
T Miyake y M Demerec examinaron mutaciones que requieren p.pdf
T Miyake y M Demerec examinaron mutaciones que requieren p.pdfT Miyake y M Demerec examinaron mutaciones que requieren p.pdf
T Miyake y M Demerec examinaron mutaciones que requieren p.pdfacsmadurai
 
Systen outprintln encrypted zessage Systezoutprin.pdf
Systen outprintln encrypted zessage   Systezoutprin.pdfSysten outprintln encrypted zessage   Systezoutprin.pdf
Systen outprintln encrypted zessage Systezoutprin.pdfacsmadurai
 
Suzy is a fourteen year old teenager she resides with her u.pdf
Suzy is a fourteen year old teenager she resides with her u.pdfSuzy is a fourteen year old teenager she resides with her u.pdf
Suzy is a fourteen year old teenager she resides with her u.pdfacsmadurai
 
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdf
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdfSzl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdf
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdfacsmadurai
 
Symbiodinium is a dinoflagellate with a genome size that enc.pdf
Symbiodinium is a dinoflagellate with a genome size that enc.pdfSymbiodinium is a dinoflagellate with a genome size that enc.pdf
Symbiodinium is a dinoflagellate with a genome size that enc.pdfacsmadurai
 
Szleme hukuku S9 Kitty tm mal varln byk kz Meghana .pdf
Szleme hukuku  S9 Kitty tm mal varln byk kz Meghana .pdfSzleme hukuku  S9 Kitty tm mal varln byk kz Meghana .pdf
Szleme hukuku S9 Kitty tm mal varln byk kz Meghana .pdfacsmadurai
 
Tace rie to the tent Gedit coling Assume the foltowng hist.pdf
Tace rie to the tent Gedit coling Assume the foltowng hist.pdfTace rie to the tent Gedit coling Assume the foltowng hist.pdf
Tace rie to the tent Gedit coling Assume the foltowng hist.pdfacsmadurai
 
symbol inputEnter stock ticker a symbolsplit .pdf
symbol  inputEnter stock ticker  a symbolsplit  .pdfsymbol  inputEnter stock ticker  a symbolsplit  .pdf
symbol inputEnter stock ticker a symbolsplit .pdfacsmadurai
 
Symons Vs Heaton Gary Plachek and Curtis Symons met in 1.pdf
Symons Vs Heaton    Gary Plachek and Curtis Symons met in 1.pdfSymons Vs Heaton    Gary Plachek and Curtis Symons met in 1.pdf
Symons Vs Heaton Gary Plachek and Curtis Symons met in 1.pdfacsmadurai
 
tances along a road in a forest The skidding distances in .pdf
tances along a road in a forest The skidding distances in .pdftances along a road in a forest The skidding distances in .pdf
tances along a road in a forest The skidding distances in .pdfacsmadurai
 
taught enough math and science Do parents feel differently .pdf
taught enough math and science Do parents feel differently .pdftaught enough math and science Do parents feel differently .pdf
taught enough math and science Do parents feel differently .pdfacsmadurai
 
Synergy effects is abstractly defined as the interplay betw.pdf
Synergy effects is abstractly defined as  the interplay betw.pdfSynergy effects is abstractly defined as  the interplay betw.pdf
Synergy effects is abstractly defined as the interplay betw.pdfacsmadurai
 
Telehealthtelemedicine has become increasingly important i.pdf
Telehealthtelemedicine has become increasingly important i.pdfTelehealthtelemedicine has become increasingly important i.pdf
Telehealthtelemedicine has become increasingly important i.pdfacsmadurai
 
Tablo 102 Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdf
Tablo 102  Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdfTablo 102  Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdf
Tablo 102 Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdfacsmadurai
 
Team ProjectPresentation 20 Students are expected to wo.pdf
Team ProjectPresentation 20  Students are expected to wo.pdfTeam ProjectPresentation 20  Students are expected to wo.pdf
Team ProjectPresentation 20 Students are expected to wo.pdfacsmadurai
 
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdf
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdfTek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdf
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdfacsmadurai
 
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdf
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdfTedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdf
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdfacsmadurai
 
TCL global strategy at one of Chinas largest consumer e.pdf
TCL   global strategy at one of Chinas largest consumer e.pdfTCL   global strategy at one of Chinas largest consumer e.pdf
TCL global strategy at one of Chinas largest consumer e.pdfacsmadurai
 
TCO 1 Celeste pasa la mayor parte de su tiempo en el tra.pdf
TCO 1  Celeste pasa la mayor parte de su tiempo en el tra.pdfTCO 1  Celeste pasa la mayor parte de su tiempo en el tra.pdf
TCO 1 Celeste pasa la mayor parte de su tiempo en el tra.pdfacsmadurai
 

More from acsmadurai (20)

T X Projection of Di An Fo Isobaric diagr illustrating.pdf
T  X Projection of Di  An  Fo Isobaric diagr illustrating.pdfT  X Projection of Di  An  Fo Isobaric diagr illustrating.pdf
T X Projection of Di An Fo Isobaric diagr illustrating.pdf
 
T Miyake y M Demerec examinaron mutaciones que requieren p.pdf
T Miyake y M Demerec examinaron mutaciones que requieren p.pdfT Miyake y M Demerec examinaron mutaciones que requieren p.pdf
T Miyake y M Demerec examinaron mutaciones que requieren p.pdf
 
Systen outprintln encrypted zessage Systezoutprin.pdf
Systen outprintln encrypted zessage   Systezoutprin.pdfSysten outprintln encrypted zessage   Systezoutprin.pdf
Systen outprintln encrypted zessage Systezoutprin.pdf
 
Suzy is a fourteen year old teenager she resides with her u.pdf
Suzy is a fourteen year old teenager she resides with her u.pdfSuzy is a fourteen year old teenager she resides with her u.pdf
Suzy is a fourteen year old teenager she resides with her u.pdf
 
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdf
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdfSzl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdf
Szl ve poster sunumlar arasndaki benzerlik ve farkllklar a.pdf
 
Symbiodinium is a dinoflagellate with a genome size that enc.pdf
Symbiodinium is a dinoflagellate with a genome size that enc.pdfSymbiodinium is a dinoflagellate with a genome size that enc.pdf
Symbiodinium is a dinoflagellate with a genome size that enc.pdf
 
Szleme hukuku S9 Kitty tm mal varln byk kz Meghana .pdf
Szleme hukuku  S9 Kitty tm mal varln byk kz Meghana .pdfSzleme hukuku  S9 Kitty tm mal varln byk kz Meghana .pdf
Szleme hukuku S9 Kitty tm mal varln byk kz Meghana .pdf
 
Tace rie to the tent Gedit coling Assume the foltowng hist.pdf
Tace rie to the tent Gedit coling Assume the foltowng hist.pdfTace rie to the tent Gedit coling Assume the foltowng hist.pdf
Tace rie to the tent Gedit coling Assume the foltowng hist.pdf
 
symbol inputEnter stock ticker a symbolsplit .pdf
symbol  inputEnter stock ticker  a symbolsplit  .pdfsymbol  inputEnter stock ticker  a symbolsplit  .pdf
symbol inputEnter stock ticker a symbolsplit .pdf
 
Symons Vs Heaton Gary Plachek and Curtis Symons met in 1.pdf
Symons Vs Heaton    Gary Plachek and Curtis Symons met in 1.pdfSymons Vs Heaton    Gary Plachek and Curtis Symons met in 1.pdf
Symons Vs Heaton Gary Plachek and Curtis Symons met in 1.pdf
 
tances along a road in a forest The skidding distances in .pdf
tances along a road in a forest The skidding distances in .pdftances along a road in a forest The skidding distances in .pdf
tances along a road in a forest The skidding distances in .pdf
 
taught enough math and science Do parents feel differently .pdf
taught enough math and science Do parents feel differently .pdftaught enough math and science Do parents feel differently .pdf
taught enough math and science Do parents feel differently .pdf
 
Synergy effects is abstractly defined as the interplay betw.pdf
Synergy effects is abstractly defined as  the interplay betw.pdfSynergy effects is abstractly defined as  the interplay betw.pdf
Synergy effects is abstractly defined as the interplay betw.pdf
 
Telehealthtelemedicine has become increasingly important i.pdf
Telehealthtelemedicine has become increasingly important i.pdfTelehealthtelemedicine has become increasingly important i.pdf
Telehealthtelemedicine has become increasingly important i.pdf
 
Tablo 102 Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdf
Tablo 102  Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdfTablo 102  Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdf
Tablo 102 Bir i merkezinde ilenmeyi bekleyen aadaki alt i .pdf
 
Team ProjectPresentation 20 Students are expected to wo.pdf
Team ProjectPresentation 20  Students are expected to wo.pdfTeam ProjectPresentation 20  Students are expected to wo.pdf
Team ProjectPresentation 20 Students are expected to wo.pdf
 
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdf
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdfTek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdf
Tek yumurta ikizleri ayn yumurtadan gelir ve dolaysyla ayn c.pdf
 
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdf
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdfTedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdf
Tedarik iin ortak hedefler aadakilerin tmn ierir HAR.pdf
 
TCL global strategy at one of Chinas largest consumer e.pdf
TCL   global strategy at one of Chinas largest consumer e.pdfTCL   global strategy at one of Chinas largest consumer e.pdf
TCL global strategy at one of Chinas largest consumer e.pdf
 
TCO 1 Celeste pasa la mayor parte de su tiempo en el tra.pdf
TCO 1  Celeste pasa la mayor parte de su tiempo en el tra.pdfTCO 1  Celeste pasa la mayor parte de su tiempo en el tra.pdf
TCO 1 Celeste pasa la mayor parte de su tiempo en el tra.pdf
 

Recently uploaded

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 

Recently uploaded (20)

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 

Task Implement the 12 classes 5 enums and one interface s.pdf

  • 1. Task: Implement the 12 classes, 5 enums, and one interface shown in the diagram above and then answer the questions at the end of the document. Class Design: Zoo A zoo contains a collection of animals. Animal An animal is a living creature. Each animal has a name, species, & weight. An animal may be able to fly, swim, or walk. An animal can breathe either through lungs or through gills. A mother animal can deliver babies either though laying eggs or through live birth. Animals are either cold or warm blooded. Their skin may be covered with fur. Animal in this project is an interface. AbstractAnimal An abstract class to implement the Animal interface. An abstract class cannot be instantiated. Many of the methods are defined as abstract, leaving it for one of the eight subclasses to define. Bird, Amphibian, Mammal, Reptile, Fish, FlightlessBird, SwimmingMammal, DuckBilledPlatypus subclasses of AbstractAnimal, any of which can be instantiated into an object. Defines the methods left as abstract in AbstractAnimal. All of these subclasses have a similar argument signature. AnimalFactory a class with a single static method, getInstance(), which, depending on the species of the animal, will create the appropriate subclass of AbstractAnimal. You are not meant to create Animals using the constructors for the subclasses of Abstract. Depending on the species of the animal. There are two ways to do this: 1. Use a giant if block to examine the animals species and return an object of the correct subtype of AbstractAnimal, or 2. Implement a hash map where the key is the animal species, and the value is an object of the appropriate subtype of AbstractAnimal. Use the map get() method to return the subtype of Animal given the species of the animal. ZooKeeper The zookeeper admits animals into the zoo and keeps track of the animals in it. It is the only class in this project with a main() method, and the only method in this class is main. Tasks: 1. Build the 5 enumerations: a. Birth, b. BloodTemp, c. Movement, d. Respiration, e. Skin Covering 2. Implement the Animal interface, the AbstractAnimal class and all the subclasses of AbstractAnimal. Put these classes in the package edu.bergen.zoo 3. Implement the AnimalFactory class. Its getInstance() method should return one of: a. Bird b. Mammal c. Reptile d. Amphibian e. Fish f. FlightlessBird
  • 2. g. SwimmingMammal, h. DuckBilledPlatypus based on the value of species provided in the argument list. Hint#1 Use an if block, checking on the value of species, and return an object of the appropriate subclass of AbstractAnimal, or Hint#2 = create a HashMap, where the key is the name of the species, and the value is an object of the appropriate subclass of AbstractAnimal 4. Implement the Zoo class. Put this class in the package edu.zoo 5. Build a ZooKeeper class. In its main() method, do the following tasks: a. Construct a Zoo object. b. Create the following ten Animals using AnimalFactory.getInstance(), and use the Zoo.addAnimal() method in put them in the Zoo. The ten animals are: i. Eli the Elephant (3000 lbs) ii. Betty the Boa (20 lbs) iii. Katerina the Kangeroo (600 lbs) iv. Voldomir the Vampire (10 lbs) v. Oksana the Ostrich (300 lbs) vi. Sophia the Salamander (2 lbs) vii. Gianluca the Giraffe (800 lbs) viii. Lisa the Lion (700 lbs) ix. Samuel the Shark (300 lbs) x. Harry the Hawk (10 lbs) c. Print the name and species of all the animals in the zoo that lay eggs. d. Print the name and species of all the animals in the zoo that are cold blooded e. Print the name and species of all the animals in the zoo that breathe through their gills f. Print the name and species of all the animals in the zoo that lay eggs. g. Print the toString() for the animal named Lisa h. How many animals are in the zoo?