Create a base class called “Animal” which has two (2) class fields. The first field holds an integer “IDtag” for a number that a zoo uses to catalogue their animals and the second field holds a string called “species.” From the Animal class, derive two (2) classes. One is called “Bird” and the other “Reptile”. E.g. Species could be (for the Bird class) ostrich, dove, chicken etc. and (for the Reptile class) lizard, snake, bearded dragon etc. The Bird class has an additional class field called “colour” which holds the colour of the birds feathers (int – 1=grey, 2=white, 3=black). The reptile class has an additional class field called “bloodTemp” which hold the reptile’s temperature of their blood (double). You need to instantiate two (2) objects. The bird object will be called “brd” and the reptile object called “rept.” Input values for the bird’s IDtag, species and feather colour (int) and for the reptile’s IDtag number, species and bloodTemp. Override the Animal class’s input and output methods.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

Create a base class called “Animal” which has two (2) class fields. The first field holds an integer “IDtag” for a number that a zoo uses to catalogue their animals and the second field holds a string called “species.”
From the Animal class, derive two (2) classes. One is called “Bird” and the other “Reptile”. E.g. Species could be (for the Bird class) ostrich, dove, chicken etc. and (for the Reptile class) lizard, snake, bearded dragon etc.
The Bird class has an additional class field called “colour” which holds the colour of the birds feathers (int – 1=grey, 2=white, 3=black). The reptile class has an additional class field called “bloodTemp” which hold the reptile’s temperature of their blood (double).
You need to instantiate two (2) objects. The bird object will be called “brd” and the reptile object called “rept.”
Input values for the bird’s IDtag, species and feather colour (int) and for the reptile’s IDtag number, species and bloodTemp. Override the Animal class’s input and output methods.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning