Question: Language: Java Graphics package: https://s3.amazonaws.com/udacity-hosted-downloads/graphics.zip SnowmanViewer class: /** * A class to view snowmen from the Snowman class. * * @author Kathleen O'Brien */ public
Language: Java
Graphics package: https://s3.amazonaws.com/udacity-hosted-downloads/graphics.zip
SnowmanViewer class:
/** * A class to view snowmen from the Snowman class. * * @author Kathleen O'Brien */ public class SnowmanViewer { public static void main(String[] args) { Snowman snowman = new Snowman(50, 10); snowman.draw(); Snowman snowman1 = new Snowman(110, 50); snowman1.draw(); Snowman snowman2 = new Snowman(170, 100); snowman2.draw(); } } Snowman has a constructor that takes the x and y coordinates of the upper left hand corner of the rectangular part of the hat as parameters and stores them in the instance variables. Do not draw in the constructor.
Snowman has a draw method that can draw the Snowman at its x,y coordinates. It takes no parameters
draw method specifications:
The upper left hand corner of the hat is at x, y.
The hatbox is 20 x 20 and filled with black
The line for the hat brim at the bottom of the hat extends 10 pixels further than the hatbox on each side.
The diameter of the small circle is 20. The upper left hand corner of its bounding rectangle is at (x, y + 20)
The diameter of the middle circle is 40
The diameter of the bottom circle is 60.
Provide Javadoc for the class itself, the constructor and the draw method.
Remember you need to import the graphics classes into the Bluej project.
SnowmanViewer draws several Snowmans at different locations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
