Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started