wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OCR A Level Computer Science - 1.4.x

Total questions: 67

Worksheet time: 34mins

Name
Class
Date
1.
Variables cannot be changed.
a)
False
b)
True
2.
Constants cannot be changed.
a)
True
b)
False
3.
Variable names can't start with a number.
a)
True
b)
False
4.

5.23 would be stored as:

a)

Integer

b)

Real Number

c)

String

d)

Character

e)

Boolean

5.
Which of the following is a datatype?
a)
Function
b)
Diagram
c)
String
d)
Element
6.
Comparison Operators
What is >= ?
a)
Greater than
b)
Less than
c)
Greater than or equal to
d)
Less than or equal to
7.
Comparison Operators
What is < ?
a)
Greater than
b)
Less than
c)
Greater than or equal to
d)
Less than or equal to
8.

Comparison Operators

What is A > B?

a)

A greater than B

b)

A less than B

c)

Greater than or equal to

d)

Less than or equal to

9.
Comparison Operator
What is <= ?
a)
Greater than
b)
Less than
c)
Greater than or equal to
d)
Less than or equal to 
10.
Logical Operators
What is && ? 
a)
And
b)
Or
c)
Not
d)
Less than
11.
Comparison Operators
What is != ?
a)
Equal to
b)
Equal value and equal type
c)
Not equal
d)
Not equal value or not equal type
12.
Comparision Operators
What is == ? 
a)
Equal to 
b)
Equal value and equal type
c)
Not equal
d)
Not equal value or not equal type
13.

Arithmetic Operators What is a/c ? 

a)

Addition

b)

Subtraction

c)

Division

d)

Modulo

14.

5 would be stored as:

a)

Integer

b)

Real Number

c)

String

d)

Character

e)

Boolean

15.

M / F would be stored as:

a)

Integer

b)

Real Number

c)

String

d)

Character

e)

Boolean

16.

"The cat sat on the mat" would be stored as:

a)

Integer

b)

Real Number

c)

String

d)

Character

e)

Boolean

17.

Conversion of one data type to another e.g.

age = "30" # this is a string!

YearsOld=int(age)


is known as...?

a)

Declaring

b)

Assigning (or Assignment)

c)

Casting

d)

Concatenation

18.

Which of these is not a data structure?

a)

Stack

b)

Array

c)

Integer

d)

List

19.

Which of these are operations of a stack?

a)

Push

b)

Add

c)

Remove

d)

Pop

20.

A stack is last in, "what" out?

(a)  

21.

A queue is what?

a)

Last in, first out

b)

First in, first out

c)

First in, last out

d)

Last in, last out

22.
A tree is composed of ____ connected by edges or lines.
a)
Fruit 
b)
Leaf Node
c)
Root Node
d)
Nodes
23.
A Kind of tree where every node in a tree can have at most two children.
a)
Binary Tree
b)
Binary Expression Tree
c)
Tree
d)
Binary Search Tree
24.

What is the value of the ROOT node in this Tree?

a)

35

b)

24

c)

42

d)

20

25.

In this tree, where would the new value "7" be placed?

a)

On the left branch of "4"

b)

On the right branch of "6"

c)

On the left branch of "15"

d)

Over the top of the current number "5"

26.

What is returned by values[5]?

a)

9

b)

12

c)

6

d)

8

27.
int nums[ ] =
{2, 3, 5, 8, 9, 11};
How would you access the fourth element in nums
a)
nums[4]
b)
nums[3]
c)
nums(4)
d)
nums(3)
28.

If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

29.

Consider the following operation performed on a stack of size 5.


Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);


After the completion of all operation, the no of element present on stack are

a)

1

b)

3

c)

2

d)

4

30.

Records allow you to store more than one data type

a)

True

b)

False

31.

What advantage does a linked list have over an array?

a)

Size of the list doesn't need to be mentioned at the beginning of the program

b)

You can add or remove elements from the middle of the list.

c)

The linked list doesn't have a size limit

d)

All of these are true.

32.

A hash table is

a)

an abstract data structure

b)

an array

c)

an integer

d)

made of pine

33.

when an algorithm generates the same address for different primary keys it is known as

a)

Knock

b)

Bang

c)

Collisions

d)

DoubleHash

34.

Hashing gives each item

a)

A sequential address

b)

A logarithmic address

c)

No address

d)

A unique address

35.

When a collision occurs with a hashing function, what is one method for dealing with the collisions?

a)

creating a new linked list at that index

b)

creating a new array

c)

creating a new hash table

d)

creating a new binary tree

36.

¬¬A =

a)

A

b)

1

c)

0

d)

¬A

37.

A ∧ A =

a)

A

b)

1

c)

0

d)

¬A

38.

A ∧ ¬A =

a)

A

b)

1

c)

0

d)

¬A

39.

A ∧ 1 =

a)

A

b)

1

c)

0

d)

¬A

40.

A ∧ 0 =

a)

A

b)

1

c)

0

d)

¬A

41.

A v A =

a)

A

b)

1

c)

0

d)

¬A

42.

A v ¬A =

a)

A

b)

1

c)

0

d)

¬A

43.

A v 1 =

a)

A

b)

1

c)

0

d)

¬A

44.

A v 0 =

a)

A

b)

1

c)

0

d)

¬A

45.

A v AB =

a)

A

b)

1

c)

0

d)

¬A

46.

Applying DeMorgan's rule to:

¬(A v B) gives

a)

¬(A v B)

b)

¬A v ¬B

c)

¬A ∧ ¬B

d)

¬(A ∧ B)

47.

Applying DeMorgan's rule to:

¬(A ∧ B) gives

a)

¬(A v B)

b)

¬A v ¬B

c)

¬A ∧ ¬B

d)

¬(A ∧ B)

48.

Which of the following are logic gates?

a)

AND

b)

Switch

c)

IF

d)

Else

e)

OR

49.

Which logic gate is shown here?

a)

OR

b)

NOT

c)

AND

d)

NAND

50.

What would the ouput(z) be if the inputs were the following?


A=1

B=0

a)

0

b)

1

51.

Which logic gate is shown here?

a)

AND

b)

OR

c)

XOR

d)

NAND

52.

What would the output (z) be if the inputs were the following?

A=1

B=0

a)

0

b)

1

53.

Which logic gate is associated with the  truth table?


a)

NAND

b)

OR

c)

NOT

d)

AND

54.

Which logic gate is represented by the following symbol, ¬ ?

a)

AND

b)

OR

c)

NOT

d)

NAND

55.

Which logic gate is represented by the following symbol, V ?

a)

NAND

b)

AND

c)

OR

d)

NOT

56.

Which logic gate is associated with the following truth table?

a)

AND

b)

NAND

c)

OR

d)

OR

57.

The OUTPUT of which logic gate will be O, if there is more than 1 INPUT switched ON.

a)

AND

b)

OR

c)

XOR

d)

NAND

58.

What is the output of a NAND gate if both its inputs are 1?

a)

0

b)

1

59.

Which logic gate can be represented by the following symbol, ^?

a)

OR

b)

NOT

c)

AND

60.

Which logic gate is associated with the truth table?

a)

AND

b)

OR

c)

NAND

d)

NOR

61.

What would the OUTPUT(x) be in the following scenario:

A = 1

B = 0

C= 0

a)

0

b)

1

62.

What is the OUTPUT in the logic diagram?

a)

0

b)

1

63.

Look at the truth table below and choose the correct option.

a)

False, False

b)

True, False

c)

False,True

d)

True,True

64.

Which logic gate does this symbol represent?

a)

NAND

b)

NOR

c)

OR

d)

XOR

65.

Which logic gate does this symbol represent?

a)

NOR

b)

OR

c)

XOR

d)

NAND

66.

What would the OUTPUT be in the following scenario?

A=0

B=0

C=0

a)

0

b)

1

67.

How could this logic expression also be written?

P=Av¬B

a)

P= A AND B

b)

P= A AND ( NOT B)

c)

P=A OR (NOT B)

d)

P=A OR B