Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA * PROBLEM 3: The following function draws mickey mouse, if you call it like * this from main: * * * draw (.5, .5,

JAVA

* PROBLEM 3: The following function draws mickey mouse, if you call it like

* this from main:

*

*

* draw (.5, .5, .25);

*

*

* Change the code to draw mickey moose instead. Your solution should be

* recursive.

*

* Before picture: http://fpl.cs.depaul.edu/jriely/ds1/images/MickeyMouse.png

* After picture: http://fpl.cs.depaul.edu/jriely/ds1/images/MickeyMoose.png

*

* You may not use any "fields" to solve this problem (a field is a variable

* that is declared "outside" of the function declaration --- either before

* or after).

*/

public static void draw (double centerX, double centerY, double radius) {

if (radius < .0005) return;

StdDraw.setPenColor (StdDraw.LIGHT_GRAY);

StdDraw.filledCircle (centerX, centerY, radius);

StdDraw.setPenColor (StdDraw.BLACK);

StdDraw.circle (centerX, centerY, radius);

double change = radius * 0.90;

StdDraw.setPenColor (StdDraw.LIGHT_GRAY);

StdDraw.filledCircle (centerX+change, centerY+change, radius/2);

StdDraw.setPenColor (StdDraw.BLACK);

StdDraw.circle (centerX+change, centerY+change, radius/2);

StdDraw.setPenColor (StdDraw.LIGHT_GRAY);

StdDraw.filledCircle (centerX-change, centerY+change, radius/2);

StdDraw.setPenColor (StdDraw.BLACK);

StdDraw.circle (centerX-change, centerY+change, radius/2);

}

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_2

Step: 3

blur-text-image_3

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

The jet engine does not produce shaft work; how is power produced?

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago