WorksheetsOzaria CH1L1-4: Exam Review
Total questions: 20
Worksheet time: 10mins
Fill in the blank: ________ is the order in which lines of code are written and executed.
Sequence
Loop
Condition
Function
My friend liked the following aspect of my game:
(a)
An algorithm is:
a step-by-step procedure for solving a problem
a type of computer hardware
a programming language
a computer virus
Method - ______ that an object can make in the game.
actions
colors
levels
scores
A syntax bug is different than a logic bug in which of the following ways?
A syntax bug is caused by incorrect code structure, while a logic bug is caused by incorrect program logic.
A syntax bug is caused by incorrect program logic, while a logic bug is caused by incorrect code structure.
Both syntax and logic bugs are caused by incorrect code structure.
Both syntax and logic bugs are caused by incorrect program logic.
Look at the code snippet shown. What type of error is this? Why do you think so?
It is a syntax error because the code does not follow the correct structure.
It is a logical error because the output is not as expected.
It is a runtime error because the code crashes during execution.
It is a semantic error because the meaning of the code is incorrect.
Object - an ______ in the game that can be controlled or moved.
object
score
level
sound
Input & Output Example 1. Buying something Input: ________ Output: ________
Input: Money; Output: Purchased item
Input: Item; Output: Money
Input: Store; Output: Money
Input: Purchased item; Output: Money
In the code snippet:
for index in range(4): helper.moveLeft() helper.build("leftArrow")
What number of times will the loop repeat its actions?
4
2
3
5
What is a Syntax Error?
A mistake made in an algorithm that does not follow the grammar rules of the programming language.
A logical error that causes the program to run incorrectly.
A type of error that occurs when the program runs out of memory.
An error that occurs due to incorrect output from the program.
Fill in the blank: An ________ is a sequence of instructions that can be used to solve a problem.
algorithm
variable
database
compiler
Sequences are:
the order in which lines of code are written and excuted.
a type of geometric shape
a mathematical operation
a random collection of objects
What is a Logic Error?
A mistake made in an algorithm that causes it to behave in a way that you don’t expect.
A syntax mistake that prevents code from running.
An error that occurs only when the program is compiled.
A hardware malfunction in the computer.
What is the first step in the example of baking cookies?
Bake
Gather ingredients
Mix ingredients
Measure ingredients
What did you like about your friend’s game?
I liked the creativity in my friend’s game.
I did not enjoy anything about my friend’s game.
I found the game too difficult to play.
I thought the game was boring.
Loops help you code your game more efficiently by:
allowing you to repeat actions without rewriting code
making the game graphics more colorful
increasing the size of your code
removing all bugs automatically
Mark where the Hero will end up. (Fill in the blank: The Hero will end up at the position ___. The starting position is marked with a red dot.)
The Hero will end up at the position two spaces up and two spaces right from the starting red dot.
The Hero will end up at the position three spaces down and one space left from the starting red dot.
The Hero will end up at the position one space up and three spaces right from the starting red dot.
The Hero will end up at the position two spaces down and two spaces left from the starting red dot.
What is a loop in programming?
A) A command that lets you repeat an action multiple times in your code.
B) A command that stops your code.
C) A command that creates a new variable.
D) A command that deletes data.
Which of the following is NOT a step in the example of baking cookies?
A) Gather ingredients
B) Measure ingredients
C) Mix ingredients
D) Decorate cookies
What will happen if this code is run?
The code will execute without any errors.
The code will throw a syntax error.
The code will result in an infinite loop.
The code will print nothing to the output.
