Font size
Worksheets2D Game Design Review
Total questions: 70
Worksheet time: 1hrs 7mins
A set of instructions that tells a computer what to do to accomplish a particular task is called:
software
an application.
a computer program.
programming language.
The set of rules that must be followed when writing program instructions for a specific programming language is called:
executing
machine language.
binary.
syntax
When a computer is performing the instructions contained in a program, it is called:
compiling
debugging
executing
assembling
Click ALL answers which result in an "X" printed.
a = 3, b = 3, c = 3
a = 5, b = 4, c = 7
a = 1, b = 3, c = 5
a = 6, b = 4, c = 3
a = 5, b = 5, c = 3
What is output?
Jackson
Memorial
JacksonMemorial
There is no ouptut
Which of the following conditional statements is executed?
The if statement
if (z == 3) { ... }
The else if statement
else if (z < 5) { ... }
The else statement
else { ... }
None of them
What will be the value of after this set of conditional statements?
a += 2; means a = a + 2;
a += 3; means a = a + 3;
7
9
10
4
Which of these is the correct format for an "if/else" statement?
Which of these is the proper format of an "else/if" chain statement?
Which of the following includes the correct syntax for a for loop?
for(int i = 0, i<10, i++)
for(int i =0, run = 10)
for(int i = 0; run = 10)
for(int i = 0; i < 10; i++)
for(int i; i<10; i++) {} Why won’t this code segment run?
There is a missing semicolon at the end.
For should be capitalized
The person did not set the beginning value of i.
The person did not set the ending value of i.
Loop
Loops that have a predetermined beginning, end, and increment (step interval).
The action of doing something over and over again.
A description of the behavior of a command, function, library, API, etc.
To repeat in order to achieve, or get closer to, a desired goal.
Name the data type: false
String
boolean
int
None of the above
What data type would you use for storing the number of students in a class?
boolean
String
double
int
What data type would you use to store names of students?
String
char
boolean
None of these
How would you declare a variable that tells you that someone passed a class?
boolean passed = 'true';
boolean passed = true;
passed = true;
String passed = "true";
Which declaration will throw an error?
double num = 8;
int averageGrade = 89.7;
boolean done = false;
String done = "true";
The process of breaking down your code into smaller parts (more functions)
Decomposition
Indentation
lowerCamelCase
Start Function
The visual structure of how your code is laid out. Using tabs to organize code into a hierarchy.
JavaScript
Indentation
Start Function
Algorithm
Teaching the computer a new command. Used to explain what a program should do when receiving that command.
Defining a Function
Calling a Function
Start Function
Readability
_______ a function actually gives the command, so the computer will run the code for that function.
Debugging
Indenting
Defining
Calling
A message in your code that explains what is going on -- not apart of the executing of the program.
Decomposition
Comment
Condition
Control Structure
Choose TWO: Ways (using syntax) that you can write comments?
multi-line
/*
*
*/
single line
//
multi-line
**
single line
##
What defines a sprite in a game context?
A sprite is a still image used for background decoration in a game.
A sprite is any object in a game that lacks characteristics but has behaviors.
A sprite is any object in a game that has characteristics and behaviors.
A sprite is a dynamic element in a game that only has characteristics but no behaviors.
Which is these could be a sprite?
A player character
An enemy character
An object in the game you interact with
All of the above
Should you rename your sprites, instead of keeping them named "mySprite" or "mySprite2"?
Yes, because descriptive names help you keep track of them in your code, creating organization and clarity
No, because the names given to them are fine and make programming clearer
Yes, because descriptive names enhances the visual appeal of the actual game
No, because the given names simplify the debugging process
What is an event handler in programming?
A function that is executed at the start of the program.
Code that only runs when a specific event happens.
A variable that stores the state of the program.
A loop that runs continuously throughout the program.
What do all event handlers start with?
The word "in"
The word "of"
The word "on"
The word "under"
What is one of the functions of event handlers in programming?
Calculate mathematical equations
Detect collisions
Create new files
Change the color of the screen
What does an "on button" event handler do?
It automatically presses a button for the player.
It runs code when a player interacts with a button.
It charges the controller's battery.
It creates a new button on the controller.
How many event handlers can exist for a given button and action?
As many as you want.
Only two event handlers.
Only one event handler.
No event handlers are allowed.
What is a variable in computer programming?
A) A function that performs an action
B) A named location in memory
C) A type of computer hardware
D) A command that executes a program
What is memory often conceptualized as in computer science?
A processor that executes commands.
A storage device like a hard drive.
A place where we store information.
A tool for managing computer operations.
Why do we use variable names in computer programs?
To increase the speed of the program
To make the code look more complex
To avoid confusion
To reduce the amount of memory used by the program
What is the purpose of variables in programming?
To create new programs from scratch
To store user input only
To help keep track of information that we need to reference at some point in our program
To change the behavior of the program randomly
Which of the following is an example of a string value assigned to a variable in the image?
7
"Yellow Whirled"
true
myString
Which of the following is an example of a number value assigned to a variable in the image?
7
"Yellow Whirled"
true
myString
What variable is set to a Boolean expression?
myNumber
myString
myLogic
myArray
What are conditions?
Functions that perform a specific task
Expressions that evaluate to true or false
Loops that execute a block of code multiple times
Variables that store text or numbers
How many possible values can a condition have at any time?
One
Two
Multiple
Infinite
What does a conditional statement do?
It performs an action regardless of any conditions.
It checks the value of a variable or expression and acts only if that check is true.
It calculates the sum of two numbers.
It sends an email automatically.
Which of the following is an example of a real-world conditional statement?
If you are hungry, then you eat food.
If the sky is blue, then it is always daytime.
If water is cold, then it must be boiling.
If a car is red, then it goes faster.
What is an array?
An array is a variable that can store only one value, referenced by a unique identifier.
An array is a variable that can store more than one value, with each value referenced by an index.
An array is a variable that can dynamically change its size based on the number of values it contains.
An array is a variable that can store values in a sequence without requiring any indexing.
A runtime error
is when the program is coded correctly, but an error occurs because of a problem while the program is being executed (not because of a mistake in the code)
is when incorrect words or punctuation is used, or when correct words and punctuation are used in the wrong order
is when the stars don't line up properly and a cosmic ray changes a true value to a false value
is when the program is coded incorrectly to produce an incorrect result, but with correct statements. The only way to know there was an error is to notice that the result is wrong
A logic error
is when the program is coded correctly, but an error occurs because of a problem while the program is being executed (not because of a mistake in the code)
is when incorrect words or punctuation is used, or when correct words and punctuation are used in the wrong order
is when the stars don't line up properly and a cosmic ray changes a true value to a false value
is when the program is coded incorrectly to produce an incorrect result, but with correct statements. The only way to know there was an error is to notice that the result is wrong
Information with values that don’t change during a program is called a...
Algorithm
Constant
Loop
Variable
Which of these is NOT a type of variable
Sprite
Number
Array
Conditional
Pseudocode is
fake code
incorrect code
code written in sentence form
code written in Javascript only
In this picture "on start" is...
a variable
an input
a sprite
a loop
In this image "play melody" is...
an input
an output
a sprite
a loop
In this image, "repeat" is...
a conditional
a loop
an input
a variable
In this image "hand" is...
a variable
a sprite
an output
an input
The teams on this scoreboard are...
constants
variables
neither
both
The time on this scoreboard is...
Constant
Variable
Neither
Both
Which block is the conditional?
On Shake
Set Hand
If "true" then
Which of the following best describes a loop in programming?
A function that never returns a value.
A variable that stores text values.
A set of instructions that repeats until a condition is met.
A command that runs only once.
What is the main purpose of using variables in a program?
To store and manipulate data during program execution.
To repeat a set of instructions.
To define the syntax of a language.
To create user interfaces.
Which statement about conditional statements is correct?
They allow a program to make decisions based on certain conditions.
They are used only for mathematical calculations.
They store information in memory.
They are used to define new data types.
Which of the following is a valid example of a condition in programming?
x > 10
print("Hello World")
for(int i = 0; i < 5; i++)
int number = 5;
What will happen if a condition in an if statement evaluates to false?
An error will occur.
The program will stop running.
The code inside the if block will be skipped.
The code inside the if block will run.
Which data type is most commonly used to represent the result of a condition?
Double
Boolean
String
Integer
