function mystery() {
while (noBallsPresent()) {
move();
}
}
Cumulative Test Practice Units 1, 3, 4, 5, & 7
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
LaShawne Long Myles
Used 3+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
function mystery() {
while (noBallsPresent()) {
move();
}
}
Karel moves until it is on a ball
Karel moves once if there is no ball present
Karel moves until it puts down a ball
Karel checks if there is no ball on the current spot and then moves once
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location?
while (________) {
takeBall();
}
noBallsPresent()
ballsPresent()frontIsClear()takeBall()
frontIsClear()
takeBall()
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What’s wrong with this code?
function start() {
move();
go();
go();
}
function go() {
move();
move();
}
function go() {
move();
move();
}
The go function is called twice
The go function has a syntax error
The go function has been defined twice
go is not a command that Karel understands
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is wrong with this for loop?
for (var i = 0, i < 10, i + 1) {
move();
}
The for loop uses commas instead of semicolons
It should say i++ instead of i + 1
Both A and B
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
The following program should draw a circle on the screen
1 function start(){
2 var circle = new Circle(40);
3 circle.setPosition(getWidth() / 2, getHeight() / 2);
4 circle.setColor(Color.blue);
5 }
But when we run this code, we don’t see the circle. What is missing from our start function?
We are setting the position of the ball to be off the canvas.
We need to change line 3 to be
circle.setPosition(0, 0);
We are creating the circle incorrectly. We need to specify the width and height.
We need to change line 2 to be
var circle = new Circle(40, 40);
We create the circle and position it correctly on the screen, but we never add it to the screen.
We need to add the line
add(circle);
after line 4
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If you wanted to use the following code to draw a circle to the canvas with the radius, and x and y coordinates given by the user, how would you ask for this information?
var circle = new Circle(radius);
circle.setPosition(x, y);
circle.setColor(color);
add(circle);
var x = readLine(“What is the x coordinate? “);
var y = readLine(“What is the y coordinate? “);
var radius = readInt(“What is the radius of the circle? “);
var x = readLine(“What is the x coordinate? “);
var y = readLine(“What is the y coordinate? “);
var radius = readLine(“What is the radius of the circle? “);
var x = readInt(“What is the x coordinate? “);
var y = readInt(“What is the y coordinate? “);
var radius = readInt(“What is the radius of the circle? “);
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will the following code segment evaluate to?
function start(){
var a = 10;
var b = 5;
var c = 2;
var expression = ((a - b) * c) % 3;
println(expression);
}
7
5
3
1
15 questions
JavaScript Quiz
Quiz
•
9th - 10th Grade
15 questions
JavaScript Basics
Quiz
•
12th Grade - University
20 questions
Unit 1 - Introduction to Kotlin (L2)[ID]
Quiz
•
12th Grade
14 questions
Code.org Unit 3
Quiz
•
9th - 12th Grade
21 questions
CodeHS JavaScript Control Functions
Quiz
•
8th - 12th Grade
21 questions
AP COMPUTER SCIENCE FINAL
Quiz
•
11th Grade
20 questions
Debugging
Quiz
•
10th Grade
20 questions
Arrays in Java
Quiz
•
9th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade