Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java program-snowman GCompound Practice Exercise CS141 Assignment Write a class that represents a digital snowman. Your class should follow these guidelines 1. Store the following

Java program-snowman image text in transcribed
image text in transcribed
GCompound Practice Exercise CS141 Assignment Write a class that represents a digital snowman. Your class should follow these guidelines 1. Store the following private class variables a. bodyColor of type Color. b. int x, int y for the upper left comer. c. Graphics g. 2. Create two different constructor methods. a. A (int x, int y, Graphics myG) parameter constructor that makes the snowman a light gray color by default and makes x and y the upper left comer and saves the graphics panel to draw on. b. A (int x, int y, Graphics myG, Color c) parameterized constructor that requires a color as an input and then saves the color given in addition to the x and y and the graphics panel. c. Each constructor should set save the appropriate bodyColor to the necessary Color 3. Create a public drawSnowMan0 method a. Instantiate three Ovals that draw the body of the snowman. b. Make sure to shift translate the ovals based upon the proper x and y c. Your Ovals should be filled with whatever color bodyColor is set to. d. Create several Objects to draw eyes, nose and mouth on the snowman e. Create Lines to draw stick arms for the snowman. 4. Create a simple main program (main0) that displays several snowmen of different a. Create an array of3 snowmen. b. Snowman 0 should use the default constructor and hence should be gray. c. Snowman and 2 should be set to a non-gray color of your choice d. After making the snowmen, make sure to draw them to the screen. 5. Add a changeSnowManColoro method to the Snowman. a. This should change the snowman to a random color. b. Then it redraws the snowman

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago