Answer:
Hello attached is the Java program written to solve the problem
The Pet.java and Dog.java files are unaltered
Step-by-step explanation:
The input and output codes are attached as well i.e the second image is the input while the third image is the output code