wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

2425 Bell FOC Final Exam Review

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Which command makes the Karrel move forward one space in the grid?

a)

move();

b)

turnLeft();

c)

turnRight();

d)

placeMarker();

2.

Which command makes the Karrel turn 90 degrees to the left?

a)

turnLeft();

b)

move();

c)

turnRight();

d)

collectMarker();

3.

Why are functions useful in programming?

a)

They allow for code to be reused and make programs more organized.

b)

They make the program run faster.

c)

They automatically fix errors in the code.

d)

They are required for Karrel to move.

4.

What does the command turnAround() typically do in the Karrel environment?

a)

Makes the Karrel turn 180 degrees.

b)

Makes the Karrel move backward.

c)

Makes the Karrel face a random direction.

d)

It's not a standard Karrel command.

5.

What is a "while loop" used for in programming?

a)

To execute a block of code repeatedly as long as a certain condition is true.

b)

To execute a block of code a specific number of times.

c)

To define a function.

d)

To store data.

6.

What is an "if statement" used for in programming?

a)

To execute a block of code only if a certain condition is true.

b)

To repeat a block of code.

c)

To define a variable.

d)

To move Karrel forward.

7.

What does if FrontIsClear() evaluate to?

a)

True if there is no obstacle directly in front of the Ball, false otherwise.

b)

The number of markers in front of the Ball

c)

The direction the Ball is facing.

d)

The current position of the Ball.

8.

What does if BallIsPresent() evaluate to?

a)

True if there is at least one Ball current location, false otherwise.

b)

The total number of Balls in the world.

c)

The number of markers Karrel is carrying.

d)

The location of the nearest marker.

9.

What is the purpose of comments in code?

a)

To explain the code to humans.

b)

To make the code easier for the computer to understand.

c)

To make the code run faster.

d)

To automatically fix errors.

10.

How do you call or execute a function that has been defined as myFunction()?

a)

myFunction()

b)

execute myFunction

c)

call myFunction()

d)

myFunction;

11.

What is the purpose of indentation in programming?

a)

To visually structure the code and indicate blocks of code belonging to loops or conditional statements.

b)

To make the code run faster.

c)

To add comments to the code.

d)

To define variables.

12.

What is the process of identifying and fixing errors in computer programs called?

a)

Debugging

b)

Compiling

c)

Executing

d)

Designing

13.

Which of the following programming structures allows for a block of code to be executed repeatedly for a specific number of times?

a)

For loop

b)

If statement

c)

While loop

d)

Function definition

14.

Which of the following commands is a valid Karel command?

a)

move();

b)

move

c)

move;

d)

move()

15.

Why is the following command an invalid Karel command? turnleft();

a)

The l should be a capital L

b)

It should end in a colon rather than a semicolon

c)

It should start with a capital T

d)

This command is correct

16.

In this code, how many times is the dance function called and how many times is it defined?

function start() { 

 move(); 

 dance(); 

 move(); 

 move(); 

 turnLeft(); 

 dance(); 

 dance(); 


 function dance() { 

turnLeft(); 

 move(); 

 turnLeft(); 

 turnLeft(); 

 move(); 

 turnLeft();

 }

a)

Called 3 times, defined 1 time

b)

Called 1 time, defined 1 time

c)

Called 1 time, defined 3 times

d)

Called 3 times, defined 3 times

17.

What's wrong with this code?

function start() { 

 move(); 

 go(); 

 go(); 


 function go() { 

 move(); 

 move(); 


 function go() { 

move(); 

 move(); 

}

a)

The go function has been defined twice

b)

The go function is called twice

c)

The go function has a syntax error

d)

go is not a command that Karel understands

18.

How many total times will Karel move in this program?

function start() { 

 move(); 

 for (var i = 0; i < 5; i++) { 

 move(); 

 putBall(); 

 } 

}

a)

6

b)

1

c)

5

d)

7

19.

What is the proper format for a single line comment in Karel?

a)

// This is a comment

b)

/* This is a comment

c)

This is a comment

20.

What does the mystery function do?

function mystery() { 

 while (noBallsPresent()) { 

 move(); 

 } 

}

a)

Karel moves until it is on a ball

b)

Karel moves once if there is no ball present

c)

Karel moves until it puts down a ball

d)

Karel checks if there is no ball on the current spot and then moves once

21.

Say Karel is on a location with one tennis ball. After the following code runs, how many tennis balls will there be at that location?

for (var i = 0; i < 3; i++) {

 if (ballsPresent()) { 

 takeBall();

 } else { 

 putBall(); 

 putBall(); 

 } 

}

a)

1

b)

0

c)

2

d)

6

22.

How can we teach Karel new commands?

a)

Define a new function

b)

For loop

c)

While loop

d)

The start function

23.

Say you want to write a program to have Karel put down 300 tennis balls. Which control structure would you use?

a)

For loop

b)

If statement

c)

While loop

d)

Nested while loop

24.

What is top down design?

a)

Designing your program by starting with the biggest problem and breaking it down into smaller pieces.

b)

Create designs on a computer to put on a web page

c)

Designing your programs starting with the individual commands first

d)

Top down design is a way to use loops and if statements to decompose the problem

25.

What is the purpose of using a for loop in code?

a)

To repeat something a fixed number of times

b)

To do something if a condition is true

c)

To do something while a condition is true

d)

To make programs run faster

26.

In Code.org's Game Lab, what is the coordinate system typically used to position objects on the screen?

a)

Cartesian coordinates (x, y) with the origin at the top-left.

b)

Polar coordinates

c)

Cartesian coordinates (x, y) with the origin at the center.

d)

Spherical coordinates

27.

What is the purpose of the "draw loop" in Game Lab?

a)

To continuously update and redraw the elements on the screen.

b)

To define functions.

c)

To handle user input.

d)

To play sound effects.

28.

What is a "sprite" in the context of game development?

a)

A 2D image or animation that can be manipulated on the screen.

b)

A single frame of an animation.

c)

A sound effect.

d)

A background image ग्रामीण छवि।

29.

Which of the following is a common property of a sprite that can be changed in Game Lab?

a)

The sprite's x and y position.

b)

The computer's operating system.

c)

The user's mouse cursor.

d)

The programming language being used.

30.

What does createSprite(x, y, width, height) do in Game Lab?

a)

It creates a new sprite with the given position and dimensions.

b)

It moves an existing sprite to the specified coordinates.

c)

It changes the background color.

d)

It deletes a sprite.

31.

How can you make a sprite move horizontally in Game Lab?

a)

By changing its x velocity (velocityX).

b)

By changing its y velocity (velocityY).

c)

By using the move() command.

d)

Sprites cannot move in Game Lab.

32.

What does randomNumber(min, max) function do in Game Lab?

a)

Returns a random integer between min (inclusive) and max (inclusive).

b)

Returns a random floating-point number between min and max.

c)

Sets a random seed for the random number generator.

d)

Sorts a list of numbers randomly.

33.

What is "user input" in the context of interactive programs?

a)

Data or commands provided by the person using the program (e.g., keyboard presses, mouse clicks).

b)

The output displayed on the screen.

c)

The code written by the programmer.

d)

The computer's internal processing.

34.

How can you detect if a specific key has been pressed in Game Lab?

a)

Using the keyDown() function.

b)

Using the mouseIsPressed variable.

c)

Using the sprite.isTouching() function.

d)

Using the randomNumber() function.

35.

What does the isTouching() function in Game Lab do?

a)

Checks if two sprites are overlapping.

b)

Checks if the mouse cursor is over a sprite.

c)

Checks if a sprite has gone off the screen.

d)

Changes the color of a sprite when it's touched.

36.

What is a "variable" in programming?

a)

A named storage location that can hold a value.

b)

A type of loop.

c)

A function that returns a random number.

d)

A comment in the code.

37.

Which of the following is a valid variable name in JavaScript (used in Game Lab)?

a)

playerScore

b)

2ndScore

c)

game over

d)

if

38.

What is the term for a sequence of instructions that a computer follows to perform a specific task?

a)

Algorithm

b)

Hardware

c)

Software

d)

Data

39.

What is the purpose of the background() function in the draw loop?

a)

To set the background color of the canvas in each frame.

b)

To draw shapes on the screen.

c)

To load background images.

d)

To clear all sprites from the screen.

40.

How can you create an animation of a sprite in Game Lab?

a)

By loading a series of images and displaying them in sequence.

b)

By changing its color rapidly.

c)

By making it move very fast.

d)

Animations cannot be created in Game Lab.

41.

What is a "conditional statement" used for in game development?

a)

To make decisions in the game based on certain conditions.

b)

To repeat actions.

c)

To define new sprites.

d)

To draw shapes.

42.

Which of the following is a common use of conditional statements in games?

a)

A) Checking if a player's score reaches a certain value.

b)

B) Moving a sprite forward.

c)

C) Creating a new sprite.

d)

D) Setting the background color.

43.

What is a "collision" in the context of games?

a)

When two or more game objects (like sprites) come into contact.

b)

When a sprite moves off the screen.

c)

When the player presses a key.

d)

When the background color changes.

44.

How can you make a sprite bounce off the edges of the screen in Game Lab?

a)

By checking if the sprite's position exceeds the screen boundaries and reversing its velocity.

b)

By using the collide() function.

c)

By using the bounce() function.

d)

Sprites cannot bounce in Game Lab.

45.

What is the purpose of sound effects in games?

a)

To enhance the player's experience and provide feedback.

b)

To make the game run faster.

c)

To display text on the screen.

d)

To control the movement of sprites.

46.

Which function in Game Lab is commonly used to load and play sound files?

a)

loadSound()

b)

playSound()

c)

startSound()

d)

playAudio()

47.

In game development, what is the term for different identifiable stages or modes within a game, such as a menu screen, a gameplay level, or a game over screen?

a)

Game states

b)

Game settings

c)

Game variables

d)

Game functions

48.

How can you typically transition between different game states in a game program?

a)

By using conditional statements to control what is updated and drawn.

b)

By changing the background color.

c)

By creating new sprites.

d)

By increasing the game speed.

49.

What is the fundamental loop structure in many game development environments that continuously updates the game world and renders the graphics?

a)

Draw loop (or game loop)

b)

For loop

c)

While loop

d)

If statement

50.

What is the importance of testing your game or program frequently during development?

a)

To identify and fix bugs or errors early in the process.

b)

To make sure the code is long enough.

c)

To impress other programmers.

d)

To make the program run faster.