Question: Need to implement at least four classes. The first class, Animal, stores basic data about an animal. The second class Pet, stores additional data about

Need to implement at least four classes. The first class, Animal, stores basic data about an animal. The second class Pet, stores additional data about an animal which is a pet. The third class ZooAnimal, stores additional data about an animal which is kept in a zoo. The fourth class ProgThree has a main method which reads data about animals, pets and zoo animals and creates a report about animals, pets and zoo animals.

The program must be developed following the guidelines previously discussed. These guidelines include appropriate variable names, use of comments to describe the purpose of the program and the purpose of each method, and proper use of indentation of all program statements.

animalType must be a string of at least three characters.

weight must be a valid positive real number.

For Pet objects, name and owner each must be strings of at least three characters.

For Zoo Animal objects, cageNumber must be a positive integer and trainer must be a string of at least three characters.

Animal.java technical details:

One Constructor

Constructor #1. It will take all the parameters as listed:

int animalID.

String animalType. double weight.

Instance variables for the Animal class

int animalID.

String animalType. double weight.

Method which must be part of the Animal class:

A toString() method which displays information about an animal in the following format:

ID: 1015 Type: Monkey Weight: 38.6

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 Databases Questions!