Question: Drawing shapes in Java using StdDraw and loops... This is some basic code I did to draw shapes: How would I transform this into a

Drawing shapes in Java using StdDraw and loops...

This is some basic code I did to draw shapes:

Drawing shapes in Java using StdDraw and loops... This is some basic

How would I transform this into a loop to draw circles, squares, ellipses, etc.?

EDIT: I can do easy shapes like a ladder for example, however, I am having trouble making lines horizontal in a loop...

38 Std Draw. line demo 39 40 Points 41 StdDraw. settpenRadius (.03) 42 StdDraw. setPenColor (StedDraw.CYAN) 43 StdDraw point (100, 60) 44 StdDraw. setpencolor(stdDraw.cYAN) ;I 45 StdDraw.point (500, 200); 46 47 Lines (Square 48 StdDraw. settpenRadius (.01) 49 StdDraw.. setPenColor(StdDraw. YELLOW) 50 StdDraw. Line (50, 10, 250, 10) bottom 51 StdDraw. setPenColor (StedDraw. YELLOW) 52 StdDraw. Line (50, 10, 50, 173) left side 53 StdDraw. setPenColor (StedDraw. YELLOW) 54 StdDraw. Line (50, 173, 250, 173) top 55 StdDraw. setPenColor (StedDraw. YELLOW) 56 StdDraw. Line (250, 10, 250, 173) right side 58 Circles 59 StdDraw. set PenRadius (.01) 60 StdDraw. Set PenColor(StdDraw. BLACK); 61 StdDraw. circle (100, 200, 5)

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!