|
What is the Y coordinate of the top of all the squares? A good answer might be:The horizontal line across the center of the area is at Y=150/2. The top of the squares should be (300/10)/2 pixels above that, or at 150/2 - 15 (remember that Y increases going down.) | |
Finishing the Applet
So now we have the (X, Y) coordinates of the upper left corner of each of the ten squares: The left edges of the squares are at X=0, 300/10, 2*(300/10), 3*(300/10), . . . . 9*(300/10)and all the Y values are at (150/2 - 15). The X and Y in the above are local variables for exclusive use of the paint method. It is correct to declare them as is done here. The blanks should be filled in with arithmetic expressions that use identifiers, not integer literals like 10, 150, 300 and so on. | |
QUESTION 13:Fill in the blanks. (Hint: make use of count in computing a new X for each loop iteration.) Click Here after you have answered the question |