Programming Project 4.10 required adding an instance variable to the Pet class defined in Display 4.15 to indicate if the pet is a dog or cat. A better organization is to define Pet as a super class of the Dog and Cat classes. This organization eliminates the need for an instance variable to indicate the type of the pet. Do or redo Programming Project 4.10 with inheritance. The acepro mazine() and carprofen() methods should be defined in the Pet class to simply return 0. Override both methods in the Dog and Cat classes to calculate the correct dosage. Write a main method with appropriate tests to exercise the changes.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.