Reading Quiz Questions
These are the questions that will appear on the reading quizzes in week 2. Remember these quizzes take place at the start of class, and you get points for correctness, not just participation. These will be the exact questions we ask you. They will be multiple choice clicker questions, but we do not provide the answer choice here. If you can answer them without the answer choices, you'll have no problems answering them when you see the choices. These are not designed to be overly tricky.
Monday, Jan 14
1. You want to define a new method for Turtle objects called drawTriangle, so that you could call the method as follows:
World w = new World(100, 200);
Turtle jane = new Turtle(w);
jane.drawTriangle();
Where (in what file and/or class definition) must you write this method definition?
2. You want to define a new method for Turtle objects called drawTriangle, so that you could call the method as follows:
World w = new World(100, 200);
Turtle jane = new Turtle(w);
jane.drawTriangle();
What is the correct header (first line) for that method?
World w = new World(100, 200);
Turtle jane = new Turtle(w);
jane.drawTriangle();
Where (in what file and/or class definition) must you write this method definition?
2. You want to define a new method for Turtle objects called drawTriangle, so that you could call the method as follows:
World w = new World(100, 200);
Turtle jane = new Turtle(w);
jane.drawTriangle();
What is the correct header (first line) for that method?
Wednesday, Jan 16
1. How many times does the body of this loop execute?
int index = 10;
while (index>=0)
{
System.out.println("CSE8A ROCKS!");
index = index - 1;
}
2. A Pixel named pixel1 is colored Color(235,0,0). Which line would change the color of pixel1 to its "negative" color?
int index = 10;
while (index>=0)
{
System.out.println("CSE8A ROCKS!");
index = index - 1;
}
2. A Pixel named pixel1 is colored Color(235,0,0). Which line would change the color of pixel1 to its "negative" color?
Friday, Jan 18
IN CLASS EXAM