Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer these questions: Point out one place in which your design uses inheritance. Point out one place in your design uses composition. What is encapsulation?

image text in transcribed

Answer these questions:

  1. Point out one place in which your design uses inheritance.
  2. Point out one place in your design uses composition.
  3. What is encapsulation? How are details hidden from other classes?
  4. What is the "Open-Closed Principle"?
  5. Describe the guidelines that you used to design your classes.

Write a java class for each of the classes to the above instruction and answer the questions. Classes for the following classes: Enclosure, AnimalGroup, Animal, Zookeeper, Veterinarian, and Zoo. Please!

Write a java class for each of the classes In this assignment, I want someone to help me to design classes for a small number of classes You will need to decide when you will use inheritance and when you will use composition. Instructions You will design classes to keep track of which animals are in what enclosures at a zoo. To simplify this assignment, we will assume that all enclosures are equivalent, and that any set of animals can be in any enclosure Here is some information that will help you decide how to design this classes: An enclosure is where a group of animals will stay during the course of a day. An enclosure has a location code, a description of the enclosure, and is either empty or has a group of animals in it. The location code consists of three parts: 1. A capital letter, specifically A, B or C. This designates the area the enclosure is in. 2. A digit, specifically 1, 2 or 3. This designates the enclosure in the area. 3. A zookeeper assigned to enclosure. A group of animals consists of a number of animals. Sometimes it is possible for a group to have different kinds of animals in a group, so don't count on a group of being the same kinds of animals. A group will have a name, a number of all animals in the group, and a description. The group will also have a veterinarian assigned to it. An animal has an individual's name (such as Fred, Katy, Sport, etc), the name of the animal (such as zebra, kangaroo, etc), a description, a birth date, vaccination date, and a health status. A zookeeper and veterinarian both have names and addresses. A zookeeper will have a specialty, and the veterinarian will have a specialty and an hourly rate. In your report: Design classes for the following classes: Enclosure, Animal Group, Animal, Zookeeper, Veterinarian, and Zoo. Write a java class for each of the classes. I am looking for you to name the classes and put in the data members for each class. Be sure to include visibility (public/private/protected) and the data type of each class. You are free to add classes where you think it is appropriate. (Such as have both Zookeeper and Veterinarian derive from a common class). The methods in your classes must be empty (no code). This is about designing classes, not writing code. You can also create UML diagrams instead of Java classes)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago