CSCI A201/A597

Takehome Quiz Four

Second Summer 2000


Fourth set of questions due Thursday July 6, on paper. Answers will be posted Friday at noon.

Questions:

  1. What is the difference between an applet and an application?

  2. What is the difference between a browser and the applet viewer?

  3. Why do you need an HTML page to run an applet?

  4. Who calls the paint method of an applet? When does the call to the paint method occur?

  5. Why does the parameter of the paint method have type Graphics and not Graphics2D?

  6. What is the purpose of a graphic context?

  7. How do you specify a text color?

  8. What is the difference between a font and a font face?

  9. What is the difference between a monospaced font and a proportionally spaced font?

  10. What are serifs?

  11. What is a logical font?

  12. How do you determine the pixel dimensions of a string in a particular font?

  13. Which classes are used in this chapter for drawing graphical shapes?

  14. What are the three different classes for specifying rectangles in the Java library?

  15. You want to plot a bar chart showing the grade distribution of all students in your class (where A=4.0, F=0). What coordinate system would you choose to make plotting as simple as possible?

  16. Let e be any ellipse. Write Java code to plot the ellipse e and another ellipse of the same size that touches e. Hint: You need to look up the accessors that tell you the dimensions of an ellipse.

  17. Write Java instructions to display the letters X and T in a graphics window, by plotting line segments.

  18. Introduce an error in the program Intersect.java, by computing
    double root = Math.sqrt(r * r + (x - a) * (x - a));
    Run the program. What happens to the intersection points?

  19. Suppose you run the Intersect program and give a value of 30 for the x-position of the vertical line. Without actually running the program, determine what values you will obtain for the intersection points.

Last updated: July 3, 2000 by Adrian German for A201