// "Exer3b.java" - Exercise on Inheritance
//
// Create a CatClass class that inherits from HappyFaceClass.  A cat is
// a happy face with whiskers and a solid color face.  You will need to 
// examine HappyFaceClass to determine how to do this.  Remember that 
// you have access to all the internal fields and methods of HappyFaceClass.

import java.awt.*;

public class Exer3b extends HappyFaceClass
{
    //
    // Constructors
    //
    public Exer3b ()
    {
    	//clr = Color.black;
    } // Exer3b constructor


    public Exer3b (int x, int y)
    {
    	super (x, y);
    } // Exer3b constructor


    //
    // Add the extra functionality here
    //
    // Overriding paint method to draw cat face 
    void paint (Graphics g)
    {
	// Main face
	g.setColor (Color.orange);
	g.fillOval (x - radius, y - radius, 2 * radius, 2 * radius);
	g.setColor (Color.black);
	g.drawOval (x - radius, y - radius, 2 * radius, 2 * radius);
	// Mouth
	g.setColor (Color.black);
	g.drawArc (x - 4 * radius / 5, y - 4 * radius / 5,
		8 * radius / 5, 8 * radius / 5, 180, 180);
	// Eyes
	g.setColor (Color.green);
	g.fillOval (x - radius / 5 - 5, y - 2 * radius / 5 - 5, 10, 10);
	g.fillOval (x + radius / 5 - 5, y - 2 * radius / 5 - 5, 10, 10);
	g.setColor (Color.black);
	g.drawOval (x - radius / 5 - 5, y - 2 * radius / 5 - 5, 10, 10);
	g.drawOval (x + radius / 5 - 5, y - 2 * radius / 5 - 5, 10, 10);
	// Left whiskers
	g.drawLine (x - 10, y + 0, x - radius - 10, y - 20 + 0);
	g.drawLine (x - 10, y + 5, x - radius - 15, y + 5);
	g.drawLine (x - 10, y + 10, x - radius - 5, y + 20 + 10);
	// Right whiskers
	g.drawLine (x + 10, y + 0, x + radius + 10, y - 20 + 0);
	g.drawLine (x + 10, y + 5, x + radius + 15, y + 5);
	g.drawLine (x + 10, y + 10, x + radius + 5, y + 20 + 10);
	// Nose
	int[] noseX = {x+(radius/7), x-(radius/7), x};
	int[] noseY = {y-(radius/7)+4, y-(radius/7)+4, y+(radius/7)+4};
	g.fillPolygon(noseX, noseY, 3);
	// Ears
	int[] earsX = {x-radius, x-radius+(radius/15), x-radius+(radius/7)}; 
	
    } // paint method
} // Exer3b class
