Grading:
public static void main(String[] args) { // parameters are x, y, size, recursion depth draw(0.5, 0.5, .25, 6); }Each of the examples below illustrates the output produced by one of the recursive drawing methods that you are asked to implement in this task. Submit a complete, documented source file named RecursiveDrawing.java that includes implementations of each of these recursive drawing methods. The method header and comments are provided in each case below. Include screenshots of the drawings produced with each of your methods when invoked as shown in the main method above. Note that the figures below were generated by calling the respective methods with precisely the parameter values shown above. In particular, the recursion depth is 6 in all cases. The usual StdDraw scale conventions are in effect.
a)
// draw1 draws recursive pattern of n nested squares, with center at (x,y) static void draw1(double x, double y, double size, int n)
b)
// draw2 draws recursive pattern of circles (only circles should be drawn - no other figures); // three smaller circles along circumference should be centered on circumference itself, one // centered at the topmost point, the other two symmetrically left and right, each equidistant // from the others, so that the centers form the vertices of an equilateral triangle; // center of largest circle is at (x,y), size is the radius, n is the recursion depth static void draw2(double x, double y, double size, int n)
c)
// draws recursive pattern of n nested squares, with center of main square at (x,y); // size is half-width of main square, n is recursion depth of overall pattern; // a picture is worth a thousand words; look carefully static void draw3(double x, double y, double size, int n)
Grading: