The Classes Quiz

class neildiamond
{
int kentuckywoman, crackelinrose, x,y,count;
public neildiamon(int a, int b)
{
crackelinrose = a;
kentuckywoman = b;
count = 12;
}
public move(int a, int b)
{
y = b;
x = a;
}
public draw(Graphics sweetcaroline)
{
sweetcaroline.fillRect(x, y,kentuckywoman, crackelinrose);
}
}
public class neilsadaka extends java.applet.Applet
{
int count;
neildiamond nd1, nd2, nd3;
public neilsadaka()
{
nd1 = new neildiamond(70,30);
nd2 = new neildiamond(35,30);
nd3 = new neildiamond(10,30);
nd1.move(30,100);
nd2.move(65,130);
nd3.move(1,1);
count = 0;
}
public void paint(Graphics g)
{
nd1.draw(g);
nd2.draw(g);
g.drawString("The Count: "+count, 200,200);
}
}
 

1) What is the first method to run when this program starts?

2) Name any method.

3) Name any variable that is an argument to a method.

4) Who is a better singer, Neil Diamond or Neil Sadaka?

5) What does this program do when the mouse is pressed?

6) What number does the only 'drawString' print?

7-8) Draw the output of this program.








9)  Write me a loop that makes a dot at the following x values:  1,3,5,7,9





10)Write me a loop that makes a dot at the following x values:  32,16,8,4,2,1 (note each one is 1/2 the previous one)





11-15)  Write a program that