CIS 163 AA - Java Programming I - Section 5811
Quiz #1
Due Monday,
September 26, 2005
Name:
I. Definitions: please explain the following terms:
- increment
- AWT
- instance
- package
- constructor
- Math method pow(x.y)
- variable
- wrapper class
- container
- NumberFormat class
II. Question or short essay
- What is the reason for using a semicolon (;) in a java program?
- In graphics programming what purpose does the setColor method have?
- How is a method different from a class?
- How could you get a random integer somewhere from 1 to 6?
- What is the difference between a frame and a panel?
III.
Programming Exercises Write source code for the following:
- Write a program to read in the weight (in pounds) of an object and compute
and print the weight in kilograms with two decimal places. (Hint: 1 pound is
equal to 0.453592 kilogram)
- Write an applet that draws a smiling face. Give the face eyes with pupils,
ears, a nose and a mouth.