Question: 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

Write a Java Program to Draw the nested Circles SAMPLE CODE public

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!