ch04Sections1-5 - 4.7 Exercises, Problems, and Projects...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
4.7 Exercises, Problems, and Projects 4.7.1 Multiple Choice Exercises 1. java.awt 2. it is a parameter of the paint method 3. false 4. true 5. a static field of the Color class 6. the line is horizontal 7. the (x, y) coordinate of the upper-left corner of the rectangle we are drawing 8. the width and height of the rectangle we are drawing 9. 4 10. 256 4.7.2 Reading and Understanding Code 11. blue 12. 330 pixels; (350 – 20) 13. 250 pixels 14. ( 260, 20 ) ; (10 + 250, 20) 15. ( 260, 370 ); (10 + 250, 20 + 350) 4.7.3 Fill in the Code 16. g.setColor( Color.RED ); 17. g.drawString( "Fill in the Code", 100, 250 ); 18. g.fillRect( 50, 30, 100, 300 ); 19. g.fillRect( 50, 30, 50, 270 ); 20. g.fillOval( 100, 100, 200, 200 ); 4.7.4 Identifying Errors in Code 21. Graphics is an abstract class; a Graphics object cannot be instantiated. 22. There should be double quotes around the literal Find a bug , not single quotes. Single quotes are used for a single character, not a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

ch04Sections1-5 - 4.7 Exercises, Problems, and Projects...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online