Write the classes as shown in the following class diagram. Add a tester that asks the user for a cat, dog and a BigDog then call all of their methods. Note that Cat and Dog inherit from the abstract class Animal and BigDog inherits from Dog.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question
100%

Write the classes as shown in the following class diagram. Add a tester that asks the user for a cat, dog and a BigDog then call all of their methods. Note that Cat and Dog inherit from the abstract class Animal and BigDog inherits from Dog.

Animal
<<abstract>>
-name:String
+Animal(name:String)
+greets():void
abstract
Cat
Dog
+Cat (name:String)
+greets ():void .
+Dog(name:String)
+greets ():void
+greets(another:Dog): void .
Print "Woof"
Print "Woooof"
Print "Meow"
BigDog
+BigDog(name:String)
+greets(): void •
+greets(another:Dog): void.
+greets(another:BigDog): voide
Print "Wooow"
Print "Woooooow"
Print "Woooo000oow"
Transcribed Image Text:Animal <<abstract>> -name:String +Animal(name:String) +greets():void abstract Cat Dog +Cat (name:String) +greets ():void . +Dog(name:String) +greets ():void +greets(another:Dog): void . Print "Woof" Print "Woooof" Print "Meow" BigDog +BigDog(name:String) +greets(): void • +greets(another:Dog): void. +greets(another:BigDog): voide Print "Wooow" Print "Woooooow" Print "Woooo000oow"
Expert Solution
steps

Step by step

Solved in 6 steps with 1 images

Blurred answer
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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