12. What is the length of the line being drawn?

G.drawline( 50, 20, 100, 350 );

15. What is the (x, y) coordinate of the lower right corner of the rectangle being drawn?

g.drawrect( 10, 20, 250, 350 );

Fill in the code

16. This code sets the current color to red.

// assume you have a graphics object named g

// your code goes here

17. This code draws the string “fill in the code†with the lower left corner of the first character (the F) being at the coordinate (100, 250)

// assume you have a graphics object named g

// assume you have a graphics object named g

Identifying errors in code

22. Where is the error in this code sequence?

// we are inside method paint

g.drawstring( ‘Find the bug’ , 100, 200 );

23. Where is the error in this code sequence?

// we are inside method paint

g.setColor( GREEN );



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *