Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following function draws mickey mouse, if you call it like * this from main: * * * draw (.5, .5, .25); * * *

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.

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

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions