wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming Basics: Statements & Functions

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

What was developed to abstract away many of the low-level details of machine code?

a)

better RAM

b)

hard drives

c)

programming languages

d)

the ALU

2.

Just like spoken languages, programming languages have individual complete thoughts called ___

a)

statements

b)

syntax

c)

assignments

d)

conditionals

3.

The set of rules that govern the structure and composition of statements in a language is called ___

a)

statement writing

b)

syntax

c)

initialization

d)

assembly code

4.

The statement “a = 5” is what kind of programming language statement?

a)

syntax error

b)

assignment statement

c)

control flow statement

d)

conditional statement

5.

What is the best practice for naming variables?

a)

all lower case single letters

b)

element symbols

c)

whatever we want

d)

as things that make sense

6.

In the computer game, who swatted the bugs trying to get into the Harvard Mark 1?

a)

Grace Hopper

b)

Alan Turing

c)

Ada Lovelace

d)

John von Neuman

7.

Setting the beginning value of a certain variable is known as ___

a)

"initializing" the variable

b)

"setting and forgetting"

c)

"setting" the floor

d)

"anchoring" the variable

8.

What is the most common kind of Control Flow Statement?

a)

IF statements

b)

WHILE loops

c)

ELSE statements

d)

FOR loops

9.

Which type of statement is like a fork in the road?

a)

IF statement

b)

WHILE loop

c)

ELSE statement

d)

function

10.

An IF statement depends on whether an expression is true or false, so it is deemed a ___

a)

Conditional Statement

b)

Declarative Statement

c)

Initialized Value

d)

RETURN statement

11.

The lines of code that are conditional on the if-statement are nested between the IF and ___

a)

END

b)

EXIT

c)

RETURN

d)

END IF

12.

Which statement acts as a catch-all if the expression following an IF statement is false?

a)

an OVERFLOW statement

b)

a NOT statement

c)

an ELSE statement

d)

an OTHER statement

13.

What kind of loop will repeat a piece of code as long as a certain expression is true?

a)

an IF loop

b)

a WHILE loop

c)

a NEXT loop

d)

a FOR loop

14.

In an assignment statement, which side of the equal sign is analyzed first?

a)

the left side

b)

the right side

c)

the side with the longer expression

d)

the side with the shorter expresssion

15.

Which kind of loop isn't based on a condition, but is count-controlled?

a)

an IF loop

b)

a WHILE loop

c)

a NEXT loop

d)

a FOR loop

16.

To compartmentalize and hide complexity, programming languages can package pieces of code into ___

a)

fragments

b)

snippets

c)

functions

d)

compartments

17.

In different programming languages, functions might also be called ___

a)

snippets or bits

b)

methods or subroutines

c)

parts or fragments

d)

smidgens or morsels

18.

Which statement was used to send the result of the exponent code back to the part of the program that requested it?

a)

a RECOVERY statement

b)

a NEXT statement

c)

an END statement

d)

a RETURN statement

19.

When we call a single line of code where the complexity is hidden, it’s not magic, it’s the power of ___

a)

contemplation

b)

reflection

c)

abstraction

d)

detachment

20.

In modern programming, it’s uncommon to see functions longer than around ___

a)

5 lines of code

b)

10 lines of code

c)

50 lines of code

d)

100 lines of code

21.

Modern programming languages come with huge bundles of pre-written functions, called ___

a)

Modularized Code

b)

Libraries

c)

Stacks

d)

Code Collections