Inheritance Practice

Here is an interface that represents a virtual Pet.

public class Pet
{
    public void reward(int numTimes)
    {
    }

    public void punish(int numTimes)
    {
    }

    public void act()
    {
    }
}

Your task is to create two subclasses for Pet, named Dog and Cat. Each one of them should override 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();