This website is preserved for historical and scholarly reference and is no longer actively maintained.
QUIZ 8
September 8, 1997
#1. Given the problem statement: "Write a program to read in the weight (in pounds) of an object and compute and print its weight in kilograms. (one pound is equal to 0.453592 kilograms)" write the three logical steps we used in class to describe how to solve this problem
#2. The Java statement
SetCoord ( 0, 10, 8, -1 )
specifies the coordinates of the ______ ______ corner to be ( __, __ ) and the coordinates of the ______ ______ corner to be ( __, __ ).
#3. After execution of the Java code segment
double x = 0;
double y = x ;
y++ ;
Point q = new Point ( x, y ) ;
the coordinates of Point q are ( __, __ ).
#4. After execution of the Java code segment
Point p = new Point ( 0, 0 ) ;
Point q = p ;
q.move ( 0, 1 ) ;
Line myLine = new Line ( p, q ) ;
the coordinates of p are ( __, __ ) and the coordinates of q are ( __, __ ).
#5. Draw a picture (in the style of the text) to illustrate the result of the following:
Employee harry = new Employee ("Hacker, Harry", 68000);
Employee boss = harry;
boss.setSalary ( 80000 ) ;