Question: Implement the following class diagram using PHP language (Note that if you don't use OOP and copy/paste feature then you cannot finish this question on
Implement the following class diagram using PHP language (Note that if you don't use OOP and copy/paste feature then you cannot finish this question on time):
Declare Animal class as abstract and inherit Bird, Mammal, Fish, Reptile, and Insect from the Animal class.
Then create one instance of each animal kingdom with the following details:
| Animal Kingdom | Name | Age | Can Walk | Can Swim | Can Crawl | Can Fly |
| Bird | Eagle | 5 | yes | yes | no | yes |
| Mammal | Elephant | 10 | yes | yes | yes | no |
| Fish | Shark | 2 | no | yes | no | no |
| Reptile | Cobra | 3 | yes | yes | yes | no |
| Insect | Ant | 2 | yes | yes | yes | no |
Then call grow(), walk(), swim(), crawl() and fly() and again grow() on each instance.
Your output should be similar to this:
The Bird with name Eagle is now 6 yeras old Eagle is walking ... Eagle is swimming ... Sorry a Bird cannot crawl ! Eagle is flying ... The Bird with name Eagle is now 7 yeras old ----------------------------- The Mammal with name Elephant is now 11 yeras old Elephant is walking ... Elephant is swimming ... Elephant is crawling ... Sorry a Mammal cannot fly ! The Mammal with name Elephant is now 12 yeras old ----------------------------- The Fish with name Shark is now 3 yeras old Sorry a Fish cannot walk ! Shark is swimming ... Sorry a Fish cannot crawl ! Sorry a Fish cannot fly ! The Fish with name Shark is now 4 yeras old ----------------------------- The Reptile with name Cobra is now 4 yeras old Cobra is walking ... Cobra is swimming ... Cobra is crawling ... Sorry a Reptile cannot fly ! The Reptile with name Cobra is now 5 yeras old The Reptile with name Cobra is now 6 yeras old ----------------------------- The Insect with name Ant is now 3 yeras old Ant is walking ... Ant is swimming ... Ant is crawling ... Sorry a Insect cannot fly ! The Insect with name Ant is now 4 yeras old
Zip and upload all your PHP scripts.

Implement the tollowing class diagram using PHP language (Note that if you don't use OOP and copyipaste feature then you cannot finish this question on tirne). Declare Animal class as abstract and inherit Bird, Mammal, Fish Reptile, and Insect from the Animal class. I hen create one instance of each an msl kingoom wth the tollowng details: Then call grow[l, walk[], swim(?, crawi[] and fly') and again grow() on each instance. Your output should be similar to this: The Bird with name Eagle is now 6 yeras old Eagle is walking ... Eagle is swimming Sorry a Bird cannot crawl ! Eagle is flying ... The Bird with name Eagle la now 7 yeras old The Mammal with name Elephant is now 11 yeras old Elephant is walking ... Elephant is swimming ... Elephant la crawilng ... Sorry a Mammal cannot fly ! The Mammal with neme Elephant is now 12 yeras old The Fish with name Shark is now 3 yeras old Sorry a Fish cannot walk! Shark is swimming ... Sorry a Fish cannot crewl! Sorry a Fish cannot fly I The Fish with name Shark is now 4 yeras old The Reptile with name Cobra is now 4 yeras old Cobra ls walking .... Cobra is swimming ... Cobra is crawling ... Sorry a Reptile eannot fly ! The Reptile with name Cobra is now 5 yeras old The Reptlle with name Cobra Is now 6 yeras old The Insect with neme Ant ls now 3 yeres old Ant is walking ... Ant is swimming ... Ant is crawling ... Sorry a Insect cannot fly I The Insect with name Ant ls now 4 yeras old LIP and upioad all your P'PP scipts
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
