Question: cos 160 : Program 6- String Art Objectives Working with for loops. String Art String art is a form of art made by wrapping colored

 cos 160 : Program 6- String Art Objectives Working with for
loops. String Art String art is a form of art made by

cos 160 : Program 6- String Art Objectives Working with for loops. String Art String art is a form of art made by wrapping colored string around a pattern of nails. B0. 820 A20 EO E1 E2 A2 A1 A0 DO C20 Part 1 (5 points) Edge Nails First you are going to calculate the x,y coordinates of the nails. You will be using a DrawingPanel of size 401 by 401 (coordinate value are 0 400). Start with this code that calculates and prints the A points: for (int paint-0; point 20; paint t-1) { int ax = 0; int ay 400-20.point; system.out.print ("A" + point+-ax +"," ay"), System.out.printin) It prints. A0=(0,400), A1=(0,380), A2-(0,360) A2Oz(0,0). These are the coordinates of the A points shown in the diagram. Make sure you understand this code and the formulas for calculating ax and ay Now write similar loops to calculate and print the B, C, and D coordinates. Use variables: bx, by, cx, cy, dx, dy Now that you have figured out the formulas you will need, create a 401 by 401 DrawingPanel and draw all of the edge nails as 1 pxel ovals. Part 2 (5 points) Drawing the A-B corner gusset Write a new for loop from 0 to 20 and draw the lines connecting AO to BO, A1 to B1, etc. You can choose the colors. You will be using the same formulas to calculate the points that you used to draw the nails. Part 3 (5 points) Drawing the C-D corner gusset

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!