wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Y11 CS P2 mmd

Total questions: 100

Worksheet time: 53mins

Name
Class
Date
1.
What does decomposition mean?
a)
focuses on the important information only, ignoring irrelevant detail
b)
Step by step instructions on solving a problem.
c)
Thinking like a computer
d)
This is the breaking down of a complex problem into smaller parts
2.
What is an algorithm?
a)
A sequence of instructions on how to solve a problem.
b)
The breaking down of a problem into smaller parts.
c)
Focusing on important parts and ignoring the irrelevant details
d)
The recipe for a cake
3.
What are the two main ways that we represent an algorithm?
a)
By drawing pictures 
b)
Using flowcharts and pseudo code
c)
Using python and small basic
d)
Using Scratch and python
4.
What does the following flowchart symbol represent?
a)
A process
b)
An output
c)
A decision (choice)
d)
End
5.
What does the following flowchart symbol represent?
a)
Input / Output
b)
Start of flowchart
c)
A process
d)
End
6.
What does the following flowchart symbol represent?
a)
Process
b)
Input
c)
Start / End
d)
Sub-process
7.
What does the following flowchart symbol represent?
a)
A process
b)
Input / Output
c)
Start / End
d)
A sub-process
8.

Define ABSTRACTION

a)

Breaking a task into smaller tasks.

b)

Drawing a map to show how to reach a destination.

c)

Creating step by step instructions.

d)

Focusing on what is important and ignoring what is unnecessary.

9.

Define PATTERN RECOGNITION.

a)

A sequence of instructions.

b)

Looking for similarities and trends.

c)

Breaking a task into smaller tasks.

d)

Focusing on what is important and ignoring what is unnecessary.

10.
Breaking a complex problem down into smaller problems and solving each one individually.
a)
Decomposition
b)
Abstraction
c)
Programming
d)
Algorithmic Thinking
11.
Picking out the important bits of information from the problem, ignoring the specific details that don't matter.
a)
Decomposition
b)
Abstraction
c)
Programming
d)
Algorithmic Thinking
12.
Select the best description to explain what a linear search algorithm is.
a)
Put the elements in order, check each item in turn.
b)
Put the elements in order, compare with the middle value, split the list in order and repeat.
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat
13.

Select the best description to explain what a binary search algorithm is.

a)

Put the elements in order, check each item in turn.

b)

Put the elements in order, compare with the middle value, split the list in order and repeat.

c)

Elements do not need to be in order, check each item in turn.

d)

Elements do not need to be in order, compare to the middle value, split the list in order and repeat

14.
A linear search is to be performed on the list:
12   6   8  1  3
How many comparisons would it take to find number 1?
a)
1
b)
2
c)
3
d)
4
15.
A binary search is to be performed on the list:
3  5  9  10  23
How many comparisons would it take to find number 9?
a)
0-1
b)
2-3
c)
4-5
d)
I can't find the number 9
16.
A binary search is to be performed on the list:
1  5  10  13  48  68  100  101
How many comparisons would it take to find number 101?
a)
0-1
b)
1-2
c)
3-4
d)
4-5
17.
Describe an advantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
18.
Describe a disadvantage of a linear search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
19.
Describe an advantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
20.
Describe a disadvantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
21.
Describe an advantage of a linear search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
Can only work on an ordered list.  If unordered must use a linear search.
22.
Describe a disadvantage of a linear search algorithm
a)
If the criteria matches the last item in list, entire list has to be checked.
b)
Simple to code than a binary search.
c)
Quicker than a linear search.
d)
Can only work on an ordered list.  If unordered must use a linear search.
23.
Which sorting algorithm makes one swap per pass (possibly swapping an element with itself)?
a)
Selection Sort
b)
Bubble Sort
c)
Insertion Sort
d)

Linear sort

24.
Which sorting algorithm may make multiple swaps per pass?
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)

Binary sort

25.
Which sorting algorithm shifts elements instead of swapping elements if needed in each pass.
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)

Linear Sort

26.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
 
4    5    9    6    2    7

4    5    6    2    7    9 
4    5    2    6    7    9
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)

Linear Sort

27.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
 
4    8    6    2    5    7 
4    8    6    2    5    7 
4    6    8    2    5    7
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)

Linear Sort

28.
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?
 
4    8    3    9    2    6 
2    8    3    9    4    6
2    3    8    9    4    6
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)

Merge Sort

29.
We are sorting the following list in ascending order:
 
1    4    2    9    3    8    5
 
What does the list look like after one pass of the bubble sort algorithm. 
a)
1 2 4 3 8 5 9
b)
1 4 2 5 3 8 9
c)
4 2 9 3 8 5 1
d)

1 4 2 9 3 8 5

30.
We are sorting the following list in descending order:
 
1    4    2    9    3    8    5
 
What does the list look like after one pass of the selection sort algorithm.
a)
1 4 2 9 3 8 5
b)
9 4 2 1 3 8 5
c)
4 2 9 3 8 5 1
d)

Don't know

31.
We are sorting the following list in ascending order:
 
1    4    2    9    3    8    5
 
What does the list look like after one pass of the insertion sort algorithm. 
a)
1 4 2 9 3 8 5
b)
4 2 9 3 8 5 1
c)
4 1 2 9 3 8 5
d)

Don't know

32.

What does a sorting algorithm do?

a)

Finds an item of data in a list

b)

Puts a list of items into order

c)

Saves a set of data

d)

Separates a list of data

33.
Which type of sort algorithm is this?
a)
Bubble
b)
Merge
c)
Insertion
d)

Linear

34.

The following two lists are to be merged, which element will be in position 5 in the new merged list?

List 1

2 4 7 9

List 2

1 6 8 12

a)

8

b)

7

c)

6

d)

4

35.

For which of the problems would the bubble sort algorithm provide an appropriate solution. Choose all that apply.

a)

Arranging a deck of cards from the lowest to the highest value cards.

b)

Looking up a name in the phone book.

c)

Sorting a stack of paper money into denominations -- i.e., £5, £10, £20 etc.

d)

Sorting a basket of laundry into socks, shirts, shorts, and sheets.

e)

Arranging books on a bookshelf by author's last name.

36.

For what purpose would a merge sort algorithm be used?

a)

To list items alphabetically.

b)

To reorder a single list.

c)

To combine identical lists together.

d)

To reorder multiple lists into a singular ordered list.

37.

The following is not true about variable names

a)

They must be descriptive

b)

They must be in capital letters

c)

They can’t start with numbers or contain spaces

d)

They point to memory locations

38.

Consider the following expression: a = b. This means

a)

a will always be equal to b

b)

b is being renamed into a

c)

The value of memory location a gets copied into memory location b

d)

The value of memory location b gets copied into memory location a

39.

Quotation marks around a variable’s identifier imply

a)

It is an integer

b)

It is a string

c)

It is a Boolean

d)

It is a real

40.

The multiplication table is best displayed using this data type

a)

Boolean

b)

Character

c)

Integer

d)

Real

41.

This variable type can only have True or False values

a)

Boolean

b)

Integer

c)

String

d)

Character

42.

Casting refers to:

a)

Boolean algebra

b)

Rounding of reals

c)

Converting between variable data types

d)

Printing out of the program’s results

43.

A type of control structure in flowchart that statements are placed one after the other and the execution takes place starting from up to down

a)

Selection

b)

Repetition

c)

Sequence

44.

A type of control structures in flowchart that allows a statement(s) to be executed repeatedly based on certain loop condition.

a)

Repetition

b)

Selection

c)

Sequence

d)

Variable

45.

Python does not provide an array data structure, but what can we use instead?

a)

List

b)

Function

c)

File

d)

Record

46.

The file operation that loads data from an open file into a variable or data structure in memory, is called what?

a)

Close

b)

Write

c)

Open

d)

Read

47.

What is the operator used to calculate the remainder after a division ?

a)

DIV

b)

MOD

c)

/

d)

//

48.

What is the main difference between procedures and functions ?

a)

Procedures are usually longer and have more instructions

b)

Functions use parameter passing, while procedures don’t

c)

Functions are more difficult to debug

d)

Functions return values, while procedures don’t

49.

Write the output of the following code

a)

30

b)

-10

c)

10

d)

-30

50.

What is pseudocode?

a)

Simplified programming language, that is not a specific language

b)

Complicated programming language

c)

Simple programming language, which is linked to a specific language

d)

A type of cheese

51.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

name

c)

"Dave"

d)

(name)

52.

The correct way to convert user input is:

a)

birth_year = number(input())

b)

birth_year = int(input())

c)

birth_year = (input(int))

d)

birth_year = int(input)

53.

To display the following on screen Hello World! the following command should be used:

a)

print(Hello World!)

b)

print("Hello World" + !)

c)

print("Hello World!")

d)

print"(Hello World!)"

54.

You assign a value to a variable with which symbol

a)

@

b)

==

c)

=

d)

*

55.

The code you use to receive and input from the keyboard

a)

enter()

b)

add()

c)

receive()

d)

input()

56.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
57.
What is another word for 'iteration'?
a)
Selection
b)
Variable Assignment
c)
Repetition
d)
Sequencing
58.
How many times will this loop run?
a)
10
b)
9
c)
4
d)
5
59.
I want to allow the program to repeatedly ask the user to enter their guess if it does not equal the answer...Which option do I use?
a)
while guess == answer:
    guess=input()
b)
while answer != guess:
guess=input()
c)
while answer =! guess:
guess=input()
d)
while guess != answer:
guess=input()
60.

Which word completes this sentence: "Iteration makes code more ___________"

a)

Complex

b)

Efficient

c)

Simple

d)

Straightforward

61.

Which of these would work as a piece of code in Python?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

62.

If you want multiple options for your code, what should you use (after if)?

a)

elif

b)

else

c)

if

d)

select case

63.

How many variables are there in this program?

a)

2

b)

3

c)

4

d)

5

64.

What operator is being used in this program?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

65.

What would be the output of this program if the user entered "yes" then "what"?

a)

Enjoy your day

b)

it is too windy for an umbrella

c)

Take an umbrella

d)

Error

66.

What would be the output of this program if the user entered "Alien"

a)

Alienway

b)

wayAlien

c)

lienAay

d)

ayAlien

67.

How many errors are there in this code?

a)

1

b)

2

c)

3

d)

4

68.

How many errors are there in this piece of code?

a)

0

b)

1

c)

2

d)

3

69.

Which decision statement will be triggered if the variable x is less than 20?

a)

if x > 20:

b)

if x <> 20:

c)

if x == 20:

d)

if x < 20:

70.

Which of these tests whether the variable x is the same as 'Hello'?

a)

x = "Hello"

b)

x != "Hello"

c)

x == "Hello"

d)

x <> "Hello"

71.

What is the output of the following program?

a)

Yes

b)

No

c)

Error

d)

No output

72.

What would the output of this code be if the user entered the value 70?

a)

Pass

b)

Fail

c)

Merit

d)

Distinction

73.

What is the output of the following program?

a)

1 to 10 numbers

b)

1 to 5 numbers

c)

1

d)

5

74.

Defensive design is about ...

a)

Stopping other countries attacking your code

b)

Writing boring programs

c)

programs not breaking or doing "the wrong thing"

d)

stopping other people stealing your code

75.

The best idea for testing is to

a)

write the whole program and test it at the end

b)

test a simple version and keep testing as you develop

c)

test the different parts of your program

d)

get an alpha version out ASAP and let the users loose

76.

Comments help

a)

your code run better

b)

slow down your code

c)

make your code more maintainable

d)

the computer to understand your code

77.

Which of these can help maintenance (CHOOSE ALL)

a)

indentation

b)

commenting

c)

compiling

d)

blacklisting

78.

What are the features of 'Well-Maintained Code'?

a)

Comments and global variables.

b)

No indentation.

c)

Comments, indentation and suitably named variables.

d)

Local variables only.

79.

What is the main advantage of 'Well-Maintained Code'?

a)

Easy to understand.

b)

Fully tested.

c)

Can be used again in the future.

d)

Difficult to understand.

80.

What is a syntax error?

a)

When a program cannot link to the correct library, eg import math is missing.

b)

When a program runs out of memory, eg print (X[3]) when there are only 3 items in a list/array.

c)

When the rules and grammar of the programming language have not been followed, eg prnt().

d)

When a program does something unexpected, eg X/0

81.

What is a logic error?

a)

When a program cannot link to the correct library, eg import math is missing.

b)

When a program runs out of memory, eg print (X[3]) when there are only 3 items in a list/array.

c)

When the rules and grammar of the programming language have not been followed, eg prnt().

d)

When a program does something unexpected, eg X/0

82.

What does IDE stand for?

a)

Integrated Development Environment.

b)

International Development Environment.

c)

Integrated Documentation Envelope.

d)

International Documentation Envelope.

83.

When should comments be used within a program?

a)

To help describe what code and structures are expected to do

b)

To remind the developer if when lunch is

c)

To include what tests must be carried out on the code

d)

Every line, so that you know exactly what is happening

84.

Which of the following ARE advantages of using subprograms?


(Select all that apply)

a)

They make code easier to read

b)

They make code easier to debug

c)

Reduces duplicate code within a program

d)

Allows code to be "reused" by different programmers

85.

What term is used to describe data passed into/out of a program?

a)

Variable

b)

Loop

c)

Constant

d)

Parameter

86.

Which of the following statements is not true?

a)

Functions/subroutines are examples of reusable code

b)

Functions and subroutines are always appropriate in programs

c)

Using functions/subroutines make it easier to "deconstruct" a problem into smaller pieces

d)

They can make programs easier to read and understand

87.
What logic gate is this?
a)
AND
b)
OR 
c)
NOT
d)
TO
88.
What logic gate is this?
a)
AND 
b)
OR 
c)
NOT 
d)
THE
89.
What logic gate is this?
a)
OR
b)
NOT
c)
AND 
d)
THE
90.
What gate is this truth table for?
a)
AND
b)
OR
c)
NOT
d)
THE 
91.
What gate is this table for?
a)
AND
b)
OR
c)
NOT
d)
NOR
92.
What gate is this table for?
a)
AND
b)
XOR
c)
OR 
d)
NOT
93.
A NOT gate has......
a)
Two inputs and one input
b)
One input and one output
c)
One input and two outputs
d)
Two inputs and two outputs
94.

What is this diagram called?

a)

Truth Table

b)

Gate Table

c)

Output Table

d)

Input Table

95.

What is the boolean expression for this logic circuit?

a)

Q = NOT (A OR B)

b)

Q = NOT A AND B

c)

NOT A OR B = Q

d)

Q = (NOT A) OR B

96.

What is the best explanation for why a computer uses boolean logic to manipulate True and False values?

a)

It can only understand 0s and 1s

b)

It runs instructions in a binary code

c)

It doesn't have enough memory to store numbers above 1

d)

It uses transistors which can only be on or off

97.

A single logic gate is an electronic component made of transistors, which does what?

a)

Performs calculations such as binary addition

b)

Performs binary shifts left and right

c)

Combines boolean inputs to produce a boolean output

d)

Executes instructions stored in the main memory

98.

What is the boolean expression for this logic circuit?

a)

A OR B AND C = Q

b)

Q = (A AND B) OR C

c)

Q = A OR (B AND C)

d)

Q = (A OR B) AND C

99.
An example of a high-level programming language is:
a)
Python
b)
Assembly
c)
Machine code
d)
Cloud
100.
Machine code uses the binary number system.
a)
True
b)
False