CS 201: Inheritance Practice

Here is an interface that represents a virtual Pet.

public interface Pet
{
    void reward(int numTimes);
    void punish(int numTimes);
    void act();
}

Your task is to create two implementation classes for Pet, named Dog and Cat. Each one of them should implement the three methods above appropriately, as well as contain a relevant constructor. Here are some more details:

If you've written your class correctly, the following test code should work if you place it inside an appropriate main method:

    Pet fido = new Dog();
    Pet socks = new Cat();

    fido.reward(5);
    socks.punish(3);

    fido.act();
    socks.act();