Question: I need help with this project in a Java Language [lease, thank you in advance. In this project we will create a base class to

I need help with this project in a Java Language [lease, thank you in advance. In this project we will create a base class to represent animals of various kinds. Class Animal Then we will create derived classes to represent specific kinds of animals. Dog Cat Bird. Every animal has Kind of animal (Dog, Cat, Bird) Name Owner's name Date of Birth. Create a class, Animal, to hold information common to all animals. Will be a base class for derived classes representing specific kinds of animals. Define instance variables for the information that is common to all animals: private String kind_of_animal; private String name; private String owner_name; private Calendar date_of_birth; . Provide a constructor that has parameters of the same name and type: public Animal(String kind_of_animal, String name, String owner_name, Calendar dob) . Provide accessor methods for all instance variables. Same name as the instance variable with first letter capitalized. Provide a toString method. See test run.

Then; Create class Dog as a derived class from class Animal. Let class Dog have instance variables private String breed; private String favorite_treat; . The constructor for class Dog should have parameters for breed and favorite treat, in addition to the parameters for class Animal Except it doesn't need kind_of_animal, because we know that will be Dog. public Dog(String name, String owner_name, Calendar dob, String breed, String favorite_treat) . Provide accessor methods for all instance variables specific to class Dog. Provide a toString method. See test run. Add class Cat, derived from class Animal. Cats have the following attributes in addition to those of class Animal: Breed Preferred Catfood . The constructor for class Cat should have parameters for breed and preferred catfood, in addition to the parameters for class Animal Except it doesn't need kind_of_animal, because we know that will be Cat. public Cat(String name, String owner_name, Calendar dob, String breed, String preferred_catfood) . Provide accessor methods for all instance variables specific to class Cat. Provide a toString method. See test run. Create class Bird as a derived class from class Animal. Let class Bird have instance variables private String species; private double wingspan;. The constructor for class Bird should have parameters for the instance variables that are specific to class Bird, in addition to the parameters for class Animal Except it doesn't need kind_of_animal, because we know that will be Bird. public Bird(String name, String owner_name, Calendar dob, String species, double wingspan) . Provide accessor methods for all instance variables specific to class Bird. Provide a toString method. See test run.

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!