
Unit 1 CSA Code
Quiz
•
Computers
•
12th Grade
•
Medium
Gareth Yeoman
Used 3+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
A Painter object called myPainter is facing north. Consider the following code segment.
while (!myPainter.isFacingSouth()) {
myPainter.turnLeft();
}
myPainter.turnLeft();
The effect of this code is that the myPainter object is now:
facing north
facing east
facing west
facing south
Answer explanation
This code runs you will turnLeft until you face south. Once you face south you will turnLeft 1 time in this example. This means you will face east.
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following is a TRUE statement about constructors in Java?
The constructor contains all of the methods that an object can utilize.
The constructor is used to create objects of a class.
The constructor should not have the same name as the class.
In inheritance, the parent class should always contain the keyword super.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
A Painter object called myPainter is initially facing east. Consider the following code segment.
while (myPainter.canMove()) {
myPainter.move(); }
After the loop has terminated, which of the following MUST be true?
The Painter object is blocked from moving north.
The Painter object is blocked from moving south.
The Painter object is blocked from moving east.
The Painter object will crash into an object or wall.
Answer explanation
When painter can move it will continue until it runs into a wall
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following are inherited when one class extends another?
I. private attributes
II. public constructors
III. public methods
II and III
I and II
III only
I only
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Consider the following class headers.
public class Food { //implementation not shown }
public class Dessert extends Food { //implementation not shown }
public class Cookie extends Dessert { //implementation not shown }
Which statement below is true regarding the class declarations?
I. Food is a subclass of Cookie
II. Dessert is a superclass of Cookie
III. Cookie is a subclass of Dessert
IV. Cookie is a superclass of Food
II and III
II and IV
I and II
III only
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following evaluates to false?
I. true
II. !true
III. false
IV. !false
III and IV
II and III
I and IV
III only
Similar Resources on Wayground
0 questions
CS A Unit 1 Review
Quiz
•
0 questions
Unit 1
Quiz
•
0 questions
CSA - Final Review
Quiz
•
0 questions
AP CSA | U1: Object-Oriented Programming By Mr. Benvenuto
Quiz
•
0 questions
Java Inheritance and Method Quiz
Quiz
•
0 questions
AP CSA Unit 1 Review
Quiz
•
0 questions
AP CSA Unit 9 - Inheritance
Quiz
•
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
