wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Unit 1 Exam

Total questions: 35

Worksheet time: 3hrs 55mins

Name
Class
Date
1.

How many times will the word “Yellow” be displayed

a)

1

b)

2

c)

3

d)

60

2.

How many times will the word “Orange” be displayed

a)

1

b)

2

c)

3

d)

60

e)

120

3.

How many times will the word “Blue” be displayed

a)

1

b)

2

c)

3

d)

60

e)

120

4.

What two concepts does the code primarily demonstrate?

a)

Input and Selection

b)

Output and Iteration

c)

Output and Selection

d)

Event-Driven Programming and Selection

e)

Event-Driven Programming and Iteration

5.

How many times will the word “Pencil” be displayed

a)

1

b)

2

c)

6

d)

24

e)

120

6.

How many times will the word “Eraser” be displayed

a)

1

b)

2

c)

6

d)

24

e)

120

7.

How many times will the word “Paper” be displayed

a)

1

b)

2

c)

6

d)

24

e)

120

8.

How many times will the word “Marker” be displayed

a)

1

b)

2

c)

24

d)

120

9.

What are the possible results of this expression?

a)

2, 8

b)

2, 3, 4, 5, 6, 7

c)

2, 3, 4, 5, 6, 7, 8

d)

3, 4, 5, 6, 7

e)

3, 4, 5, 6, 7, 8

10.

What are the possible results of the expression?

a)

1, 2, 3

b)

1, 2, 3, 4, 5

c)

1, 3, 5, 7, 9

d)

3, 4, 5

e)

4, 5, 6, 7

11.

What are the possible results of this expression?

RANDOM(1,5) * 3

a)

1, 2, 3, 4, 5

b)

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

c)

3, 6, 9, 12, 15

d)

3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

e)

5, 10, 15

12.

What is the result of the following expression?

a)

2

b)

3

c)

5

d)

7

e)

9

13.

What is the result of the following expression?

a)

2

b)

3

c)

5

d)

7

e)

9

14.

What is the result of the following expression?

(20 MOD 11) - (2 MOD 5)

a)

2

b)

3

c)

5

d)

7

e)

9

15.

What are the two components of abstraction?

a)

sequencing and iteration

b)

sequencing and detail removal

c)

generalization and iteration

d)

detail removal and iteration

e)

detail removal and generalization

16.

Why are parameters important part of procedural abstraction?

a)

They allow programmers to generalize patterns of code to be executed.

b)

They trigger pieces of code to be run in response to an event taking place.

c)

They give programmers a tool for repetition through looping.

d)

They serve as a means of documenting code.

e)

They are the means to displaying data on the screen.

17.

Which statement is most true about procedural abstraction?

a)

Procedural abstraction breaks down programs into less manageable pieces.

b)

Procedural abstraction allows programmers to generalize functionality instead of duplicating code.

c)

Procedural abstraction reduces the number of commands the computer needs to execute.

d)

Procedures can be declared multiple times but are only called once.

e)

Employing procedures as program documentation is considered a best practice.

18.

A potential development process includes the following three phases:

design -> implement/coding -> testing .

In which phase would you be programming your solution?

a)

Testing

b)

Design

c)

Implementation

d)

Abstraction

e)

None of the above

19.

A potential development process includes the following three phases:

design -> implement/coding -> testing.

In which phase would you be more likely to be looking for errors in your code?

a)

Design

b)

Implementation

c)

Testing

d)

Abstraction

e)

None of the above

20.

What is event-driven programming?

a)

When a program contains no interaction with the user

b)

When a program’s code is triggered by certain actions occurring, such as mouse clicks

c)

When a program’s code contains detail removal and generalization through parameters

d)

When a program executes it’s entire code run in sequential order

e)

When a program doesn’t run due to errors

21.

Which of the following programming commands is related to the concept of program output.

a)

RANDOM(1, 10)

b)

DISPLAY(“Hello World”)

c)

10 MOD 5

d)

INPUT()

e)

None of the above

22.

Which of the following are examples of program output?

a)

Arguments to procedure input variables

b)

Video and text on the screen

c)

Pressings keys on the keyboard

d)

Using the mouse to click on sprites

e)

All of the above

23.

Which of the following is true about event-driven programming?

a)

Event-driven programming always executes code in sequential order

b)

Event-driven programming needs sequencing and iteration

c)

Event-driven programming always includes detail removal and generalization

d)

An “event” ensures that a piece of code is repeated

e)

An “event” can occur as a response to a user action, like pushing a key on the keyboard

24.

Which statement accurately describes the use of comments in programming?

a)

Comments can assist programmers in keeping track of the functionality of their code.

b)

Comments are used to conceal the implementation details of the code.

c)

Comments are responsible for triggering the execution of program code in event-driven programs.

d)

Comments can potentially cause program execution to slow down under specific circumstances.

e)

Comments are discouraged when programming collaboratively.

25.

The image below shows the result of calling a procedure named “draw square” which has a parameter named “size”.

Which of the following procedure definitions, when called, will result in a square being drawn as shown above?

a)

b)

c)

d)

e)

None of the above

26.

What will be output when the following program is run?

a)

x y z

b)

x x y z

c)

x y z x y z

d)

x x y z x y z

e)

x x y z x x y z

27.

What will be the order of greetings printed to the screen when this program is run?

a)

Hello – Howdy

b)

Hello – Howdy – Good morning – How are you?

c)

Hello – Howdy – Good morning – How are you? – Good morning – How are you?

d)

Hello – Good morning – How are you? – Howdy

e)

Hello – Good morning – How are you? – Good morning – How are you? – Howdy

28.

Which expression will return a random even number between 1 and 10?

a)

RANDOM(1, 10)

b)

RANDOM(2, 10)

c)

RANDOM(1, 10) / 2

d)

2 * RANDOM(1, 5)

e)

2 * RANDOM(1, 10)

29.

A die is a cube with 6 sides, each side marked with a number from 1 to 6. If you were to throw (“roll”) a die, there is an equal probability that it will land on any of the numbers, 1 through 6, facing up.

Which of the following simulates a die roll displayed to the screen?

a)

DISPLAY( RANDOM(0, 6) )

b)

DISPLAY(“RANDOM 0 to 6”)

c)

DISPLAY( RANDOM(1, 6) )

d)

DISPLAY(“RANDOM 1 to 6”)

e)

None of the above

30.

Which of the following answer choices best describes procedures?

a)

A mechanism for storing and using program data.

b)

A sequence of characters, including letters, numbers, and symbols.

c)

A set of instructions that are repeated a specific number of times.

d)

A set of instructions that enable programs to branch and skip executing code.

e)

A collection of statements that can be reused as needed.

31.

What will be the result of executing the following Snap! expression?

a)

2

b)

3

c)

4

d)

5

e)

6

32.

What will be the result of executing the following expression?

(9 / 3) + ((2 * 2) – 3)

a)

2

b)

3

c)

4

d)

5

e)

6

33.

What will be the result of executing the following Snap! expression?

a)

2

b)

3

c)

4

d)

5

e)

6

34.

What will be the result of executing the following expression?

30 MOD 8

a)

2

b)

3

c)

4

d)

5

e)

6

35.

What will be displayed after calling the following procedure?

a)

1, 2, 3, 4, 5

b)

1, 2, 3, 4, 5, 6, 7, 8, 9, 10

c)

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

d)

2, 4, 6, 8, 10

e)

2, 4, 6, 8, 10, 12, 14, 16, 18, 20