wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Fundamentals of Programming (GCSE Computer Science AQA)

Total questions: 22

Worksheet time: 12mins

Name
Class
Date
1.

What is selection programming?

a)

A condition selects which code to repeat.

b)

A condition selects which lines of code to run.

c)

Any code that selects variable assignments.

d)

Selecting to run every single line of code.

2.

While loops and for loops are examples of ...

a)

selection programming.

b)

sequential progtramming.

c)

iteration programming.

d)

boolean programming.

3.

name <-- USERINPUT("Enter name: ")

pirateName <-- "Cap'n" + name

OUTPUT "Aye aye " + pirateName

a)

This is iteration programming.

b)

This is selection programming.

c)

This is Python programming.

d)

This is sequence programming.

4.

A real/float data type is ...

a)

Any decimal or whole number, positive or negative.

b)

Any whole number, positive or negative.

c)

Any real word in the dictionary.

d)

Any True boolean statement.

5.

The name of the data type that is either true or false:

a)

Integer

b)

Real

c)

Boolean

d)

String

6.

Which data type can be described as a list of a different data type.

a)

Integer

b)

Character

c)

Boolean

d)

String

7.

Select the valid structure for a single if statement:

a)

IF ELIF ELIF ELSE ELSE

b)

IF ELIF ELIF ELIF ELSE

c)

ELIF IF ELIF ELIF ELSE

d)

IF IF ELIF ELIF ELSE

8.

a <-- 7

IF a <= 5 AND a >= 0 THEN

a <-- 5

ELIF a > 5 THEN

a <-- a

ELSE

a <-- 0

ENDIF

OUTPUT a

a)

Final output is 7.

b)

Final output is 0.

c)

Final output is 5.

d)

Syntax error, final output cannot be determined.

9.

Where does the selection statement start?

a <-- 7

IF a <= 5 AND a >= 0 THEN

a <-- 5

ELIF a > 5 THEN

a <-- a

ELSE

a <-- 0

ENDIF

OUTPUT a

a)

line 1

b)

line 2

c)

line 4

d)

line 6

10.

Which line uses variable assignment?

a <-- 7

IF a <= 5 AND a >= 0 THEN

a <-- 5

ELIF a > 5 THEN

a <-- a

ELSE

a <-- 0

ENDIF

OUTPUT a

a)

line 1

b)

line 2

c)

line 4

d)

line 6

11.

Which lines uses a boolean operator?

a <-- 7

IF a <= 5 AND a >= 0 THEN

a <-- 5

ELIF a > 5 THEN

a <-- a

ELSE

a <-- 0

ENDIF

OUTPUT a

a)

Line 1

b)

Line 2

c)

Line 4

d)

Line 6

12.

When does the for loop start?

total <-- 0

FOR i <-- 1 TO 5

total <-- total + i

ENDFOR

OUTPUT total

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 5

13.

Which line adds a value on to total?

total <-- 0

FOR i <-- 1 TO 5

total <-- total + i

ENDFOR

OUTPUT total

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 5

14.

How many times will this loop run?

total <-- 0

FOR i <-- 1 TO 5

total <-- total + i

ENDFOR

OUTPUT total

a)

3

b)

4

c)

5

d)

6

15.

What boolean logic gate is this?

a)

AND

b)

OR

c)

NOT

d)

XOR

16.

Which boolean Logic Gate is this?

a)

AND

b)

OR

c)

NOT

d)

XOR

17.

Which Boolean Logic Gate is this?

a)

AND

b)

OR

c)

NOT

d)

XOR

18.

What will be printed?

a <-- TRUE

b <-- FALSE

IF (a AND b) OR (NOT b) THEN

OUTPUT "Yes"

ELSE

OUTPUT "No"

a)

Yes

b)

No

c)

Yes No

d)

Nothing will be printed.

19.

A is ON, B is OFF, C is ON.

What is the final Z output.

a)

ON

b)

OFF

c)

3

d)

Impossible to tell

20.

T is ON C is OFF R is ON.

What is the output at W?

a)

ON

b)

OFF

c)

3

d)

Nothing.

21.

year <-- "19"

name <-- hedgest

username <-- year + name


What does the + do?

a)

Adds together numbers

b)

String concatenation

c)

Adds together variables

d)

Signifies upper case.

22.

What is the final output?

message <-- "hello"

OUTPUT CAPITALISE(message)

a)

MESSAGE

b)

HELLO

c)

hello

d)

Hello