Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Program to Draw the nested Circles SAMPLE CODE public static String nestedCircle (double x, double y, double radius, double diff, Draw page,

Write a Java Program to Draw the nested Circles

image text in transcribed

SAMPLE CODE

public static String nestedCircle (double x, double y, double radius, double diff, Draw page, String radiusList) { // your code goes here. Task 1 return ""; }

Task 1: warm-up To start, you are required to implement the method called nestedCircle () recursively, which gets 6 input parameters and return a string. This method keeps drawing circles with the same center and different radius until the radius gets negative. The output of the method is a list of all the circles' radius from the most outer to the most inner one. Please see the javaDoc of this method for more information. Sample Call: PE1.nestedCircle (0.5, 0.5, 0.4, 0.05, blankCanvas, "") Corresponding Output: [0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05, 0.0]

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions