wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Logical Thinking: JavaScript Wizard

Total questions: 45

Worksheet time: 30mins

Name
Class
Date
1.

Aiko and DJ are setting up a new computer in their classroom. They are discussing the parts they can physically touch, like the monitor, mouse, and keyboard. What are these physical components of the computer system called?  

a)

Hardware

b)

Software

c)

Input Device

d)

Output Device

2.

Alaric, Alexis, and Devin are working together on a group project. To demonstrate "technology literacy," what must they be able to do?

a)

Understand text lingo

b)

Effectively communicate information through a variety of apps and technology sources

c)

Effectively use technology to evaluate sources

d)

All of the above

3.

Ben and Alexis are working on a coding project. They notice that something in their program is causing it to not run as expected. What is this issue called?

a)

Error report

b)

Bug

c)

Mistake

d)

Algorithm

4.

Bill is teaching Julian how computers work. He explains that an instruction for the computer, and many of these put together make up algorithms and computer programs. What is this instruction called?

a)

Code

b)

Plan

c)

Program

d)

Command

5.

Ben and Alejandro are working on a computer program for their class project. They notice that the program isn't working as expected, so they carefully look for and fix the errors in their code. What is this process called?

a)

Tech support

b)

Decompose

c)

Debugging

d)

Fixing

6.

DJ and Aiko are learning to program Karel. Which of these is a valid Karel command?

a)

move;
move;

b)

MOVE

c)

move();

d)

move()

7.

Peter and Javier are programming a robot to play a game. What command should they use to make the robot place a ball down in a spot?

a)

placeBall();

b)

Putball();

c)

putball():

d)

putBall();

8.

In a city grid where Ramere and Alaric are helping Karel navigate, what does a 'street' represent in Karel's world?

a)

A row.

b)

A column.

c)

A single point.

d)

Karel's position.

9.

In a city grid, Matthew and Aiko are learning about directions. If Matthew tells Aiko to walk along an avenue, what is he asking her to walk along?

a)

A row.

b)

Karel's position.

c)

A column.

d)

A single point. 

10.

Peter and Devin are curious about what a computer programmer does. What is the main job of a computer programmer?

a)

Put together the computer and plug it in.

b)

Write computer code that tells a  computer what to do.

c)

Play computer games.

11.

If Alexis is facing north and wants to turn right, how many times should Alexis turn left?

a)

1

b)

2

c)

3

d)

4

12.

DJ and Sawyer are learning how to program Karel. What can they use to teach Karel to turn right?

a)

Functions

b)

Variables

c)

Dog treats

d)

Karel can already turn right

13.

Alaric and Oneil are working on a project where they need to water the plants in their school garden every day. In coding terms, what is the action of doing something over and over again, like watering the plants daily?

a)

Repeating

b)

Repetition

c)

Loop

d)

Do-over

14.

During a school science fair, Howayek set up a project where pressing a button would turn on a light. What is the action of pressing the button called?

a)

program

b)

event

c)

binary

d)

digit

15.

Ben and Ramere are trying to bake a cake. They follow a list of steps to finish the task. What is this set of instructions called, which can be performed with or without a computer? 

a)

Algorithm

b)

Plan

c)

Binary

d)

Logorithm

16.

Ben and Alexis are working together on a programming project. How many times should the start function be defined in their program?

a)

0

b)

1

c)

2

d)

However many you like

17.

Oneil is helping Ben understand a program by adding explanations in the code. What is a code comment?

a)

A way to teach Karel a new word

b)

A way to give notes to the reader to explain what your code is doing

c)

A message to your teacher in code

d)

A place to write whatever you want in your code

18.
Karel only knows 4 commands.
a)
True
b)
False
19.

Oneil and Matthew are programming a robot to help them in the garden. Which of the following commands is incorrect?

a)

putBall();

b)

Takeball();

c)

move();

d)

turnLeft();

20.

While working on a group coding project, Matthew tells Ben that every command must end with {}. Is this statement true?

a)

True 

b)

False

21.

Oneil and DJ are working on a computer project. Running the code is...

a)

when a computer completes a command

b)

Using the instructions the programmer has put in

c)

Both of the above

22.

Matthew and Alexis are discussing what they can create using programming. What can they make?

a)

Games

b)

Websites

c)

Apps

d)

All of these

23.

Ramere and Ben are learning to program Karel the Robot in their computer class. What are the commands that Karel can do?

a)

Move();

Turnleft();

Putball();

Takeball();

b)

turnLeft

move

putBall

takeBall

c)

takeBall();

putBall();

turnLeft();

move();

d)

Move;

Turnleft;

Putball;

Takeball;

24.

Ben is helping Karel move and place balls in the grid. Which code will help Ben put Karel in the position shown in the second world? (Click on the image to enlarge it)

a)

putBall(); putBall(); move(); move();

b)

move(); putBall(); move(); putBall();

c)

putBall(); move(); putBall(); move();

d)

move(); putBall(); putBall(); move();

25.

Javier wrote the following function to help a robot move forward four steps. Is this function written correctly? (Click on the image to enlarge it)

a)

True

b)

False

26.

DJ, Alaric, and Daniel are working together on a school project where they need to write a computer program. Why would they use functions in their program?

a)

Break down their program into smaller parts

b)

Avoid repeating code

c)

Make their program more readable

d)

All of the above

27.

Oneil is programming a robot to move in a square. The code in the picture shows the instructions Oneil wrote. (Click on the image to enlarge it)

a)

True

b)

False

28.

Derek is programming a robot to help him in a game. He wrote the following instructions for the robot (Click on the image to enlarge it):

Which line(s) contains the bug?

a)

1 and 3

b)

3 only

c)

5 only

d)

3 and 5

29.

Matthew and Alejandro are programming a robot to pick up and place balls in a maze. They want to simplify their code by using a turnRight function. What lines would Matthew and Alejandro replace with the turnRight function?

a)

Lines 4 & 5

b)

Lines 7 - 9

c)

Lines 8 - 10

d)

Lines 4 & 5 and lines 8 - 10

30.

Ramere is programming a robot to complete a task. Here are the instructions he wrote:

  1. move();
  2. turnLeft();
  3. putBall();
  4. move();
  5. putball;

Which line contains the bug?

a)

1 and 5

b)

2 only

c)

3 only

d)

5 only

31.

Bill is helping Karel the dog move around the grid. Which code below will put Karel in the position shown in the picture?

a)

move(); Move(); turnLeft(); move();

b)

move; move(); turnLeft; move();

c)

move(); move(); TurnLeft(); Move();

d)

move(); move(); turnLeft(); move();

32.

Ramere and Oneil want to write a function to help them make pancakes by putting 3 balls. What is the right way to write the function:

makePancakes (Clue: this pancake will be made by putting 3 balls)

a)

function makePancakes(){

putBall();

putBall();

putBall();

}

b)

function makePancakes()

putBall();

putBall();

putBall();

c)

function makePancakes: {

putBall();

putBall();

putBall();

}

d)

function makePancakes(){

putBall();

}

33.

Matching - Connect the Command to its Action

a)

move();

1.

Karel takes one step forward in the dire

b)

turnLeft();

2.

Karel turns 90 degrees to the left.

c)

debug(); (assume the function is defined)

3.

find an error and apply the fix.

d)

turnRight();

4.

Karel turns 90 degrees to the right. (As

e)

comment();

5.

describe what a code/command does

34.

Match the Concept to its Description

a)

The horizontal rows in Karel's grid are called

1.

Streets

b)

The vertical columns in Karel's grid are called

2.

Avenues

c)

The intersection of a street and an avenue is called a

3.

Corner

d)

Karel can be positioned on and move between these.

4.

Corners

e)

This object blocks Karel's path. Karel cannot move through it.

5.

Wall

35.

When Sawyer and Aiko are following a recipe, each (a)   in the recipe is completed in a (b)   order.

Choose from the below words

sequence

specific

random

selection

36.

Match the following

a)

While Loop

1.

A loop that continues to repeat while a condition is true

b)

Define

2.

Figure out the details of the problems that you are trying to solve

c)

Behavior

3.

An action that a sprite performs continuously until it's told to stop

d)

Algorithm

4.

A list of steps to finish a task

37.

Alaric and Ramere are discussing what gives instructions to a computer. What are these programs called?

a)

keyboard

b)

mother board

c)

hardware

d)

software

38.

Daniel writes a set of commands into a program. What does he do to tell the computer to start executing these commands?

a)

event

b)

run program

c)

function

d)

abstraction

39.

5. Peter is playing a game where he moves around a grid. What is the name of the grid that Peter lives in?

a)

Define A Function

b)

Fencepost Problem

c)

World

d)

Karel

40.

Howayek and Ramere are working together on a coding project. They wrote the following code to help a robot make pancakes:

This is an example of...

a)

calling a function

b)

defining a function

c)

writing a for loop

d)

writing a comment

41.

Julian and Alexis are working together to create instructions for a robot to follow. What is the correct definition of the word program in this context?

a)

a set of code that runs one after the other in a machine

b)

an algorithm that has been coded to run in a machine

c)

a set of numbers and words that are interpreted by a machine

d)

a computer language that is understood by the machine

42.

Aiko and Daniel are working together on a coding project. They notice that their program is not working as expected, so they start looking for and fixing problems in their code. What is this process called?

a)

Fixing

b)

Correcting

c)

Debugging

d)

Deissuing

43.

Alexis is writing a program and wants to use a function she created. The definition of the function must occur before Alexis calls it in her code.

a)

true

b)

false

44.

Read the diagram for the conditional statement about Aiko's evening routine. According to the diagram, if it is not 10:00 ​p.m. (a)   . If it is 10:00 p.m., ​ (b)   .

Choose from the below words

work on homework

go to sleep

45.

Alexis is programming a robot to help in a classroom activity. What does this code do?

a)

Moves forward 1 time

b)

Moves forward forever

c)

Moves forward 5 times

d)

Moves left