import java.awt.*;
class Snowperson
{
int xCoor;
int yCoor;
int width;
int height;
public Snowperson()
{
xCoor = 0;
yCoor = 0;
width = 0;
height = 0;
}//end default
public Snowperson(int x, int y, int wid, int hght)
{
xCoor = x;
yCoor = y;
width = wid;
height = hght;
}//end default
public int getX()
{
return xCoor;
}
public int getY()
{
return yCoor;
}
public int getH()
{
return height;
}
public int getW()
{
return width;
}
public void drawSnowBottom(Graphics g)
{
g.fillOval(xCoor,yCoor,width, height);
}//end draw snow bottom
public void drawSnowMiddle(Graphics g)
{
g.fillOval(xCoor+19,yCoor-128,width-49,height-40);
}//end draw snow middle
public void drawSnowTop(Graphics g)
{
g.fillOval(xCoor+50, yCoor-211,width/2, height/2);
}//end draw snow top
public void addNose(Graphics g)
{
g.setColor(Color.orange);
Polygon nose = new Polygon();
nose.addPoint(xCoor+100,yCoor-160);
nose.addPoint(xCoor+100,yCoor-150);
nose.addPoint(xCoor+125,yCoor-155);
g.fillPolygon(nose);
}
public void addArms(Graphics g)
{
g.setColor(Color.black);
g.drawLine(xCoor+25,yCoor-75,xCoor-10,yCoor+10);
g.drawLine(xCoor+165,yCoor-75,xCoor+190,yCoor+10);
}
public void addEyes(Graphics g)
{
g.setColor(Color.black);
g.fillOval(xCoor+80,yCoor-180,10,10);
g.fillOval(xCoor+110,yCoor-180,10,10);
}
public void addButtons(Graphics g)
{
g.setColor(Color.black);
g.fillRect(xCoor+90,yCoor-50,10,10);
g.fillRect(xCoor+90,yCoor,10,10);
g.fillRect(xCoor+90,yCoor+50,10,10);
}
private void addHat(Graphics g)
{
g.setColor(Color.red);
Polygon hat = new Polygon();
hat.addPoint(xCoor+65,yCoor-198);
hat.addPoint(xCoor+135,yCoor-198);
hat.addPoint(xCoor+115,yCoor-238);
hat.addPoint(xCoor+165,yCoor-258);
hat.addPoint(xCoor+85,yCoor-248);
g.fillPolygon(hat);
g.setColor(Color.white);
g.fillOval(xCoor+165,yCoor-263,10,10);
}
public void drawSnowperson(Graphics g)
{
g.setColor(Color.white);
drawSnowBottom(g);
drawSnowMiddle(g);
addHat(g);
drawSnowTop(g);
g.setColor(Color.orange);
addNose(g);
addArms(g);
addEyes(g);
addButtons(g);
Graphics2D g2 = (Graphics2D)g;
Font font = new Font("Serif", Font.PLAIN,50);
g2.setFont(font);
g2.drawString("Happy Holidays!", 100, 150);
}//end draw snow person
}//end class SnowpersonAG
class skiir extends Snowperson
{
private Color myPink;
private Color myGBlue;
private Color myOrange;
private Color mahogany;
private Color myGrey;
public skiir()
{
xCoor = 0;
yCoor = 0;
width = 0;
height = 0;
}//end default
public skiir(int x, int y, int wid, int hght)
{
super (x,y,wid,hght);
Color myGrey= new Color(162,162,162);
Color myPink= new Color(255,130,182);
Color myGBlue = new Color(69,78,97);
Color myOrange = new Color(255,128,3);
Color mahogany = new Color(145,20,0);
{
xCoor = x;
yCoor = y;
width = wid;
height = hght;
}//end default
}
public int getX()
{
return xCoor;
}
public int getY()
{
return yCoor;
}
public int getH()
{
return height;
}
public int getW()
{
return width;
}
public void drawskis(Graphics g)
{
Polygon ski1= new Polygon();
g.setColor(Color.red);
ski1.addPoint(xCoor,yCoor);
ski1.addPoint(xCoor+20,yCoor-10);
ski1.addPoint(xCoor+120,yCoor-120);
ski1.addPoint(xCoor+120,yCoor-135);
ski1.addPoint(xCoor+30,yCoor-130);
ski1.addPoint(xCoor,yCoor-20);
g.fillPolygon(ski1);
}
public void drawSnowperson(Graphics g)
{
g.setColor(Color.white);
drawSnowBottom(g);
drawSnowMiddle(g);
drawSnowTop(g);
g.setColor(Color.orange);
addNose(g);
addArms(g);
addEyes(g);
addButtons(g);
g.setColor(Color.red);
drawskis(g);
}
}