NEW
Font size
S
M
L
XL
WorksheetsCSD Unit 3
Total questions: 65
Worksheet time: 1hrs 7mins
Name
Class
Date
1.
Part of a program that does not work correctly.
a)
Bug
b)
Debugging
c)
Program
d)
Parameter
2.
Finding and fixing problems in an algorithm or program.
a)
Bug
b)
Debugging
c)
Program
d)
Parameter
3.
An algorithm that has been coded into something that can be run by a machine.
a)
Bug
b)
Debugging
c)
Program
d)
Parameter
4.
An extra piece of information passed to a function to customize it for a specific need.
a)
Bug
b)
Debugging
c)
Program
d)
Parameter
5.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
6.
What command colors a shape?
a)
color(43, 255, 0);
b)
bucket(43, 255, 0);
c)
fill(43, 255, 0);
7.
What command draws a perfect circle?
a)
ellipse(80, 60, 100, 100);
b)
circle(80, 60, 80, 60);
c)
ellipse(80, 60, 100, 105);
d)
ellipse(80, 60, 105, 100);
8.
What command draws a rectangle?
a)
rec(10, 20, 100, 200)
b)
rect(10, 20, 100, 200)
c)
rect(10, 20, 100, 200);
d)
ellipse(10, 20, 40, 40)
9.
Optional parameters don't have any value until you give them a value.
a)
True
b)
False
10.
background("blue"); will fill in the entire screen (canvas area) with the color blue.
a)
True
b)
False
11.
The line of code that will change the fill color to a pseudo random rgb setting is which of the following?
a)
fill(randomNumber(0,255),randomNumber(0,255),randomNumber(0,255));
b)
fill(randomNumber(0,255),randomNumber(0,255),randomNumber(0,255))
c)
fill(randomnumber(0,255),randomnumber(0,255),randomnumber(0,255));
d)
Dfill(randomnumber(0,255),randomnumber(0,255),randomnumber(0,255))
12.
A placeholder for a piece of information that can change.
a)
variable
b)
property
c)
sprite
d)
expression
13.
Attributes that describe an object's characteristics.
a)
variable
b)
property
c)
sprite
d)
expression
14.
A graphic character on the screen with properties that describe its location, movement, and look.
a)
variable
b)
property
c)
sprite
d)
expression
15.
Any valid unit of code that resolves to a value.
a)
variable
b)
property
c)
sprite
d)
expression
16.
A series of images that create the illusion of motion by being shown rapidly one after the other.
a)
animation
b)
frame
c)
frame rate
17.
The rate at which frames in an animation are shown, typically measured in frames per second.
a)
animation
b)
frame
c)
frame rate
18.
A single image within an animation.
a)
animation
b)
frame
c)
frame rate
19.
A variable is a container for storing a value.
a)
True
b)
False
20.
the equals sign (=) is called the assignment operator
a)
True
b)
False
21.
3 = horses; is an acceptable way to assign the value 3 to the variable named horses
a)
True
b)
False
22.
var lives = 3;
a)
assigns 3 to the variable lives
b)
assigns 3 to the variable lives
c)
declares a variable named lives and then initializes the value of lives to 3
d)
initializes the value of the variable lives to 3
23.
A single value of either TRUE or FALSE.
a)
boolean
b)
conditionals
c)
expression
d)
Boolean expression
24.
Statements that only run under certain conditions.
a)
boolean
b)
conditionals
c)
expression
d)
Boolean expression
25.
In programming, an expression that evaluates to True or False.
a)
boolean
b)
conditionals
c)
expression
d)
Boolean expression
26.
Any valid unit of code that resolves to a value.
a)
boolean
b)
conditionals
c)
expression
d)
Boolean expression
27.
The common programming structure that implements "conditional statements".
a)
boolean
b)
conditionals
c)
if-statement
d)
Boolean expression
28.
greater than
a)
>
b)
>=
c)
<
d)
<=
29.
greater than or equal to
a)
>
b)
>=
c)
<
d)
<=
30.
less than
a)
>
b)
>=
c)
<
d)
<=
31.
less than or equal to
a)
>
b)
>=
c)
<
d)
<=
32.
Which of the following is the Boolean operator to determine if two items have the same value (equal to)?
a)
=
b)
==
c)
!=
33.
Which of the following is the Boolean operator to determine if two items DO NOT have the same value (Not equal to)?
a)
=
b)
==
c)
!=
34.
What will print on the console by the following program?
var sprite1 = createSprite(100, 200);
var sprite2 = createSprite(300, 200);// Predict what each command will print
console.log(sprite1.y == sprite2.y);
console.log(sprite1.x > sprite2.x);
console.log(sprite1.x < sprite2.y);
drawSprites();
var sprite1 = createSprite(100, 200);
var sprite2 = createSprite(300, 200);// Predict what each command will print
console.log(sprite1.y == sprite2.y);
console.log(sprite1.x > sprite2.x);
console.log(sprite1.x < sprite2.y);
drawSprites();
a)
true
false
true
false
true
b)
0
200
100
200
100
c)
true
error
true
error
true
d)
false
true
false
true
false
35.
A conditional statement tells the computer to run specific code if something is true.
a)
true
b)
false
36.
Is the dog sprite's rotation less than the cat sprite's rotation?
a)
dog.scale > cat.scale
b)
dog.x < cat.x
c)
dog.rotation < cat.rotation
d)
dog.x > cat.x
37.
Is the dog sprite's x less than the cat sprite's x?
a)
dog.scale > cat.scale
b)
dog.x < cat.x
c)
dog.rotation < cat.rotation
d)
dog.x > cat.x
38.
Is the dog sprite's scale greater than the cat sprite's scale?
a)
dog.scale > cat.scale
b)
dog.x < cat.x
c)
dog.rotation < cat.rotation
d)
dog.x > cat.x
39.
Is the dog sprite's x greater than the cat sprite's x?
a)
dog.scale > cat.scale
b)
dog.x < cat.x
c)
dog.rotation < cat.rotation
d)
dog.x > cat.x
40.
At what point in the program flow chart does the program need to make a decision?
a)
1
b)
2
c)
3a / 3b
d)
4
41.
If the comparison is false, what path will the computer take?
a)
1
b)
2
c)
3a
d)
3b
42.
when will step 4 be run by the computer?
a)
after step 3a
b)
after step 3b
c)
after either step 3a or step 3b
d)
never
43.
Pulling out specific differences to make one solution work for multiple problems.
a)
abstraction
b)
debugging
c)
if-statement
44.
Finding and fixing problems in an algorithm or program.
a)
abstraction
b)
debugging
c)
if-statement
45.
The common programming structure that implements "conditional statements".
a)
abstraction
b)
debugging
c)
if-statement
46.
Which of the following counter patterns will give the ladybug sprite greater speed?.
a)
ladybug.x = ladybug.x +.5;
b)
ladybug.x = ladybug.x + 1;
c)
ladybug.x = ladybug.x + 2;
47.
Which of the following velocity properties replaces the counter pattern of ladybug.x = ladybug.x + 5;?
a)
ladybug.velocityX = 5;
b)
ladybug.velocityX = .5;
c)
ladybug.velocityY = 5;
d)
ladybug.velocityY = .5;
48.
sprite.velocityY
a)
will affect how fast and in what direction (up or down) the sprite is moving.
b)
will affect how fast and in what direction (left or right) the sprite is moving.
c)
will affect how fast the sprite is moving.
d)
will affect what direction the sprite is moving.
49.
sprite.velocityX
a)
will affect how fast and in what direction (up or down) the sprite is moving.
b)
will affect how fast and in what direction (left or right) the sprite is moving.
c)
will affect how fast the sprite is moving.
d)
will affect what direction the sprite is moving.
50.
When used with the draw loop, sprite.rotationSpeed=10;, will cause the sprite to...
a)
rotate clockwise
b)
rotate counterclockwise
51.
When used with the draw loop, sprite.rotationSpeed= -10, will cause the sprite to...
a)
rotate clockwise
b)
rotate counterclockwise
52.
When using the block sprite.isTouching() without changing the default collide area using setCollider, a collision will be detected...
a)
in a rectangular shape around your sprite
b)
in a circular shape around your sprite
c)
only where there is the image of your sprite (the drawn in portions of your sprite only)
53.
What will happen with the sprite when this code runs?
var sprite1 = createSprite(50,200);
function draw(){
sprite1.velocityX = sprite1.velocityX + 0.1;
background("white");
drawSprites();
}
var sprite1 = createSprite(50,200);
function draw(){
sprite1.velocityX = sprite1.velocityX + 0.1;
background("white");
drawSprites();
}
a)
the sprite will travel across the screen from left to right at a constant speedOption 1*
b)
the sprite will travel across the screen from right to left at a constant speed
c)
the sprite will travel across the screen from right to left at increasing speeds
d)
the sprite will travel across the screen from left to right at increasing speeds
54.
Which of the following is the best description of what is happening in the program below?
// Create elephant sprite
var elephant = createSprite(200, 350);
elephant.setAnimation("elephant");
elephant.scale = 0.5;
elephant.velocityY = randomNumber(-3,-1);
// Create hippo sprite
var hippo = createSprite(200,50);
hippo.setAnimation("hippo");
hippo.scale = 0.5;
hippo.velocityY = randomNumber(1,3);
function draw(){
// Draw background
background("white");
// Update Sprites
hippo.displace(elephant);
drawSprites();
}
// Create elephant sprite
var elephant = createSprite(200, 350);
elephant.setAnimation("elephant");
elephant.scale = 0.5;
elephant.velocityY = randomNumber(-3,-1);
// Create hippo sprite
var hippo = createSprite(200,50);
hippo.setAnimation("hippo");
hippo.scale = 0.5;
hippo.velocityY = randomNumber(1,3);
function draw(){
// Draw background
background("white");
// Update Sprites
hippo.displace(elephant);
drawSprites();
}
a)
The elephant is moving up and the hippo is moving down. When the hippo and the elephant collide, the hippo pushes the elephant down with it.
b)
The elephant is moving down and the hippo is moving up. When the hippo and the elephant collide, the hippo pushes the elephant up with it.
c)
The elephant is moving up and the hippo is moving down. When the hippo and the elephant collide, the elephant pushes the hippo up with it.
d)
The elephant is moving down and the hippo is moving up. When the hippo and the elephant collide, the elephant pushes the hippo down with it.
55.
A piece of code that you can easily call over and over again is called a function.
a)
true
b)
false
56.
Defining a function is:
a)
giving a single name to a set of actions
b)
typing the name of the function followed by a set of parenthesis ().
57.
Calling a function is:
a)
giving a single name to a set of actions
b)
typing the name of the function followed by a set of parenthesis ().
58.
You must define the function in your code before you call the function.
a)
true
b)
false
59.
A parameter is a named value provided as input to a function.
a)
true
b)
false
60.
Which of the squares in this program will be drawn?
drawRed();
function drawRed(){
fill("red");
rect(100,100,50,50);
}
function drawGreen(){
fill("green");
rect(300,300,50,50);
}
drawGreen();
drawRed();
function drawRed(){
fill("red");
rect(100,100,50,50);
}
function drawGreen(){
fill("green");
rect(300,300,50,50);
}
drawGreen();
a)
Both squares will be drawn.
b)
The red square will be drawn.
c)
The green square will be drawn.
d)
Neither square will be drawn.
61.
Using functions is...
a)
an advantage because you don't have to keep writing the same code over and over again.
b)
a disadvantage because it makes the program longer and unorganized.
62.
Parts of your game, like avatars and enemies are:
a)
Space
b)
Components (sprites)
c)
Mechanics
d)
Goals
63.
Parts of your game, like jumping and running are:
a)
Space
b)
Components (sprites)
c)
Mechanics
d)
Goals
64.
What players try to achieve to win the game:
a)
Space
b)
Components (sprites)
c)
Mechanics
d)
Goals
65.
An example of a goal is...
a)
collecting specific number of points
b)
defeating specific number of enemies
c)
finding a key and unlocking a lock
d)
any of these can be goals
Reset
