Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Memory and Variables Quiz

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Elijah, Luna, and Anika are building a cool new app for their school project. Can you guess why they might need to use variables in their code?

a)

To store the high scores of their favorite video games in the computer's memory

b)

To constantly change the color scheme of their app

c)

To keep a count of the number of users visiting their app

d)

To create containers for storing the details of their project team members

2.

Imagine Aiden, Abigail, and Mia are on a coding adventure. They stumble upon a treasure chest that can only be opened by creating a variable. How should they do it?

a)

They should chant 'VAR keyword' followed by a secret label

b)

They should draw an EQUAL sign in the air followed by a secret label

c)

They should draw an EQUAL sign in the air followed by a magic value

d)

They should chant 'VAR keyword' followed by a magic value

3.

Imagine Aiden, Luna, and Elijah are in a coding competition. Aiden is currently leading with a score of 10. If Sophia wants to keep track of Aiden's score in her program, which of the following statements should she use?

a)

score = 10

b)

score == 10

c)

score + 10

d)

score equals 10

4.

Rohan, Abigail, and Mason are on a thrilling coding adventure! They stumble upon a mysterious variable in their code and need to uncover its value. How can they reveal the secret of this elusive variable?

a)

They can chant the ancient PRINT statement

b)

They can summon the powerful DISPLAY command

c)

They can invoke the mystical CONSOLE.LOG function

d)

They can use the magical WRITE keyword

5.

Imagine Aria, Hannah, and Abigail are working together on a thrilling coding project. Suddenly, they try to use a variable that hasn't been declared yet. What do you think would happen next in their coding adventure?

a)

The program turns into a magical genie and automatically creates the variable for them

b)

The program, like a kind wizard, assigns a default value to the variable

c)

The program, acting like a strict teacher, displays an error

d)

The program, behaving like a helpful guide, prompts them to create the variable

6.

Imagine Avery, Ethan, and Daniel are playing a thrilling game of Space Adventure. David is coding the game and needs to keep track of their scores. Why should David initialize a variable in his program?

a)

To create the variable and assign it a value, like the scores of Avery, Ethan, and Daniel

b)

To update the value of an existing variable

c)

To delete a variable from memory

d)

To check if a variable has been created

7.

Imagine David, Samuel, and Noah are in a coding competition. David is stuck because he wants to use a variable in his code but isn't sure how to refer to it. Can you help him out?

a)

By mentioning its data type

b)

By referring to its memory address

c)

By using its value

d)

By using its label

8.

David, Mason, and Scarlett are working on a fun coding project for their computer science class. They're having a lively debate about the difference between writing out a variable's value and its label. Can you jump in and help them clear up the confusion?

a)

There is no difference, both display the same information

b)

Writing out the value displays the actual data, like the score Scarlett got in the test, while writing out the label displays the variable name, like 'Scarlett_Score'

c)

Writing out the value and the label are the same thing

d)

Writing out the value displays the variable name, like 'David_Age', while writing out the label displays the actual data, like David's age

9.

Noah, Elijah, and Hannah are having a coding competition. Noah is writing a program and he wants to store a sentence 'Hello, Anika!'. Why do you think Noah would use quotes in his program?

a)

Is it to perform mathematical operations on the sentence?

b)

Is it to assign a numerical value to a variable?

c)

Is it to compare the sentence with another value?

d)

Or is it to indicate that 'Hello, Anika!' is a string of characters?