Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In any circular region of a graphics window, you could draw a simple circle: Or you could fill that region (roughly) with a set of

In any circular region of a graphics window, you could draw a simple circle:

image text in transcribed

Or you could fill that region (roughly) with a set of 7 circles, each 1/3 the size of the big circle. There will be one in the centre, and 6 more around it, spaced 60 degrees (PI/3 radians) apart:

image text in transcribed

Each of those smaller circular areas could also be drawn as a set of 7 even smaller circles:

image text in transcribed

And this process could be repeated indefinitely, to any number of levels. Write a recursive method public static void fillCircle(double x, double y, double radius, int level) which will draw this pattern in the StdDraw window, in the circular area specified by x, y, and radius, to the indicated number of levels (the images above should be created by fillCircle(0.5,0.5,0.5,n) for n=0, 1, and 2.

Write a main method which will repeatedly prompt the user for a number n between 0 and 5, and create the images above for the values of n typed in. The program should quit when a value of -1 is entered.

Standard Draw File

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

Question What happens to my plan if I die?

Answered: 1 week ago