How can we improve the following program?

Programming Fundamentals Quiz

Quiz
•
Diana Mendoza
•
Computers
•
9th Grade
•
Hard
Student preview

34 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Break down this program into more functions
Use a for loop to repeat the move command
Use a while loop to repeat the move command
Fix the indentation of this program
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following code below from the Cleanup Karel example, what is the purpose of If Statement #2?
To move the last time
To pick up the ball that is in the last spot
To pick up the ball that is in the last spot, if there is one
To take the ball from all of the positions that have a ball on them
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of using a for loop in code?
To do something if a condition is true
To do something while a condition is true
To repeat something a fixed number of times
To make programs run faster
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What makes the following command an invalid Karel command?
turnleft();
It should end in a colon rather than a semicolon
The l should be a capital L
It should start with a capital T
This command is correct
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to define a turnRight function in Karel?
function turnRight() {
turnLeft();
turnLeft();
turnLeft();
}
function turnRight() { turnRight(); turnRight(); turnRight(); }
function turnRight {
turnLeft();
turnLeft();
turnLeft();
}
turnRight function() {
turnLeft();
turnLeft();
turnLeft();
}
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we use functions in Karel programs?
Break down our program into smaller parts
Avoid repeating code
Make our program more readable
All of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What’s wrong with this code?
The go function is defined twice
go is not a command that Karel understands
The go function has a syntax error
The go function is called twice
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many total times will Karel move in this program?
1
5
6
7
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the proper format for a single line comment in Karel?
# This is a comment
// This is a comment
/* This is a comment
This is a comment.
10.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A store has 20 apples in its inventory. How can you store this information in a JavaScript variable?
var numApples == 20;
20 = numApples;
var numApples = 20;
var num apples = 20;
Explore all questions with a free account
Similar Resources on Quizizz
35 questions
Tekstapstrāde

Quiz
•
4th - 9th Grade
30 questions
HOCKY1_11

Quiz
•
1st - 12th Grade
30 questions
CodeHS Tracy the Turtle Final Test

Quiz
•
6th - 10th Grade
35 questions
Unit 8 Test Practice

Quiz
•
9th Grade
30 questions
Advanced WPD Exam

Quiz
•
9th - 12th Grade
30 questions
Assessment Term 2.2 - Y9 U4 Python Search algorithms

Quiz
•
7th - 12th Grade
31 questions
Review Quiz Programming

Quiz
•
9th Grade
36 questions
May Computing Quiz

Quiz
•
9th Grade
Popular Resources on Quizizz
17 questions
CAASPP Math Practice 3rd

Quiz
•
3rd Grade
20 questions
math review

Quiz
•
4th Grade
21 questions
6th Grade Math CAASPP Practice

Quiz
•
6th Grade
13 questions
Cinco de mayo

Interactive video
•
6th - 8th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
10 questions
4th Grade Math CAASPP (part 1)

Quiz
•
4th Grade
45 questions
5th Grade CAASPP Math Review

Quiz
•
5th Grade