This website is preserved for historical and scholarly reference and is no longer actively maintained.
QUIZ 7
September 5, 1997
#1. What value will be assigned to the variable m by each of the following?
int m = 25 / 3;
int m = 25 % 3;
int m = 3 / 25;
int m = 3 % 25;
int m = 25 / 5;
int m = 25 % 5;
Answers: 8, 1, 0, 3, 5, 0.
#2. What exactly does the following describe?
Point p = new Point(1,3);
Circle c = new Circle(p, 2.5);
c.draw();
Your answer should start with "Defines an instance of object circle named c and draws c with ..." describing the placement and dimensions of the circle c.
Answer on page 101.
#3. What is wrong with the following code?
public class Error3_2 extends GraphicsApplet
{
public void run( )
{
System.out.println("Hello Graphical World!");
Point p = new Point (1,3);
p.draw( );
}
}
Answer on page 106.