Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.) Write a program that produces the following output: // ==== OUTPUT: ---- Birds are vertebrates in the Aves class. This pelican has gray
1.) Write a program that produces the following output: // ==== OUTPUT: ---- Birds are vertebrates in the Aves class. This pelican has gray feathers and weighs 8.5 pounds. Mammals are vertebrates in the Mammalia class. This black and white dairy cow weighs 500 pounds. Press any key to continue... * 2.) Use the following UML class diagrams to specify the 3 classes. UML Diagrams: Bird featherColor : string Mammal # _name: string Animal + Animal(name: string, weight: double): Mammal hairColor : string Bird + Bird(name: string, weight: double featherColor : string): Note: Both Animal and Bird classes have a showAnimal method. Which method gets called depends on the calling object. - + Mammal(name: string, weight: double hairColor : string): In main()... 1.) Declare a Bird object named: bird Pass these values to the constructor: The feathers are gray, weight is 8.5 and the name is pelican. 2.) Declare a Mammal object named: cow - Pass these values to the constructor: Hair color is black and white, weight is 500 and name is dairy cow. 3.) Each object should call its showAnimal function.
Step by Step Solution
★★★★★
3.34 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Animaljava public class Animal protected String name protected double weight public AnimalString nam...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started