wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Foundations of Programming End of Course Exam

Total questions: 21

Worksheet time: 10mins

Name
Class
Date
1.
Which of the following is not a valid data type?
a)
Fraction
b)
Float
c)
String
d)
Integer
2.
Quotation marks around a variable’s identifier imply that it is a:
a)
String
b)
Integer
c)
Character
d)
List
3.
This variable data type can only have True or False values:
a)
Boolean
b)
Integer
c)
True/False
d)
String
4.
The statement A OR B implies that A and B are:
a)
Booleans
b)
Integers
c)
Strings
d)
Constants
5.
Casting refers to:
a)
Converting between variable data types
b)
Boolean algebra
c)
Printing out of the program’s results
d)
Sending values to a function or procedure
6.
Which of the following lines of Python code will allow a user to input their username as a variable?
a)
user = input("Input your name: ")
b)
username == input("What is your username?")
c)
print("Input your username")
d)
input("Please enter your username") = userID
7.

Which arithmetic operator is used in the sum 5 * 5 = 25?

a)

Plus

b)

Minus

c)

Multiply

d)

Modulus

8.

Which of the following would you use to find the remainder in a sum?

a)

=

b)

%

c)

>

d)

//

9.

Which of the following is the assignment operator that is used to assign a value to a variable or constant?

a)

==

b)

<

c)

=

10.

If X = 6 and Y = 3


C = X + Y

What is C?

a)

9

b)

8

c)

7

11.

Which one of these best describes a constant?

a)

A value that does not change whilst the code is running.

b)

A value that changes.

c)

A location in memory to store / a value that may change

d)

A value that cannot change

12.

Which one of these best describes a variable?

a)

A value that does not change whilst the code is running.

b)

A value that changes.

c)

A location in memory to store a value that may change

d)

A value that cannot change

13.

Which of the following would you use to find a divided value without a remainder?

a)

=

b)

%

c)

>

d)

//

14.

a = 26 mod 5

What is the value of a?

a)

1

b)

2

c)

5

d)

10

15.

a = 165 mod 16

What is the value of a?

a)

10

b)

5

c)

1

d)

16

16.

a = 165 div 16

What is the value of a?

a)

10

b)

5

c)

1

d)

16

17.

(5 % 2) > (10 // 2)

a)

True

b)

False

18.

"4" + "26" =

a)

30

b)

22

c)

426

d)

"426"

19.

4 + 26 =

a)

30

b)

22

c)

426

d)

"426"

20.

What data type would hold the value 64?

a)

Integer

b)

Boolean

c)

String

d)

Float

e)

Character

21.

What data type holds a decimal value?

a)

Integer

b)

Boolean

c)

String

d)

Float / Real

e)

Character