wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

J277 Programming - Outputting Data

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Look at the algorithm above and answer the following question:How many variables are used?

a)

1

b)

2

c)

3

d)

4

2.

Look at the algorithm above and answer the following question:How many constants are used?

a)

1

b)

2

c)

3

d)

4

3.

Look at the algorithm above and answer the following question:What is the name of the first variable used?

a)

Stone

b)

Pounds

c)

totalPounds

d)

totalKilograms

4.

What will playerName hold after running the following code? playerName = "Max" + "Jones"

a)

MaxJones

b)

maxjones

c)

max jones

d)

Max Jones

5.

The program above should add together three numbers. What line of code is the error on?

a)

1

b)

2

c)

3

d)

4

6.

Would you use a variable or constant in the following scenario: Used to store the value of pi (3.14159)

a)

Variable

b)

Constant

7.

Would you use a variable or constant in the following scenario: Used to store a score in a game

a)

Variable

b)

Constant

8.

What is a variable?

a)

A variable is a number

b)

A variable is a message input by the user

c)

A variable is a location in memory that we use to store data

9.

A variable is needed to record a student's surname. Which of the following would be the most meaningful variable name?

a)

name

b)

student_surname

c)

studentName

d)

sur

10.

What statement is used to obtain a value for a variable from a user?

a)

run

b)

get

c)

input

d)

print