wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

1.1. Problem Solving: Algorithms_CS (1-9) Edexcel

Total questions: 110

Worksheet time: 1hrs 23mins

Name
Class
Date
1.
What is the correct definition of an algorithm?
a)
An algorithm is a step by step instructions to solve a problem.
b)
An algorithm is a process of baking bread.
c)
An algorithm is a software used to compute numbers.
d)
An algorithm is the process of breaking problems.
2.
Decomposition is a term used to define...
a)
The process of assigning value to a variable.
b)
The process of taking out unnecessary details from problems.
c)
The process of breaking down problems into smaller problems.
d)
The process of coding a problem.
3.
Abstraction is.....
a)
The process of drawing abstract pictures.
b)
The process of assigning values to variables.
c)
The process of breaking down problems.
d)
The process of removing unnecessary details from a problem.
4.
What is a flowchart?
a)
A textual representation of algorithms.
b)
A graphical representation of algorithms.
c)
A cluster of different shapes.
d)
A program code written in Logo.
5.
What does this shape represent in flowchart?
a)
Start/Stop
b)
Decision
c)
Process
d)
Input/Output
6.
What is the correct symbol for an input in a flowchart?
a)
A diamon
b)
A square
c)
A parallelogram
d)
 A rectangle
7.
The process carried out in computer systems is represented by _______________ in flowchart.
a)
Rectangle
b)
parallelogram 
c)
Square
d)
Diamond
8.
What links each instruction in a flowchart?
a)
A line 
b)
A double line
c)
An arrow
d)
A double arrow
9.
Computers can solve any problem that can be computationally solved.
a)
TRUE
b)
FALSE
10.
What does this shape represent in flowchart?
a)
Input/Output
b)
Process
c)
Decision
d)
Start/Stop
11.
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
12.
What is this symbol?
a)
Decision
b)
Input/Output
c)
Start/End
d)
Process
13.
Merge Sort is?
a)
When a list is kept as one and compared
b)
List is split into 2 and merged together
c)
List is split into 2 and kept seperate
d)
Nothing
14.
Bubble sort takes the first two values of a list, and swaps them if wrong?
a)
True
b)
False
15.
What is a binary search?
a)
Each item is checked in order
b)
The list is split into 2 and compared
c)
The first 2 values are compared and moved
d)
Nothing happens
16.
A linear search is when a list is split into 2 and compared?
a)
True
b)
False
17.
Identify the description of a linear search
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare to 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
18.
Identify the description of a binary search
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare to 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
19.
Define the term abstraction within computational thinking
a)
Adding together numbers
b)
Taking a real world problem and designing a computer program that exactly replicates every part of that problem in the computer
c)
Performing multiple calculations on a list of variables
d)
Representing real world problems in a computer program, using symbols and removing unnecessary elements
20.

A linear search is to be performed on the list above.

How many comparisons would it take to find the number 1?

a)

1

b)

2

c)

3

d)

4

21.

A binary search is to be performed on the list above.

How many comparisons would it take to find the number 9?

a)

0-1

b)

2-3

c)

4-5

d)

It can't find the number 9

22.

A binary search is to be performed on the list above.

How many comparisons would it take to the find the number 101?

a)

0-1

b)

1-2

c)

3-4

d)

4-5

23.

Identify the search performed by the above algorithm

a)

Linear

b)

Binary

c)

Both linear and binary

d)

Neither, it does not work

24.
Which of the following is not a sorting algorithm?
a)
Bubble
b)
Insertion
c)
Binary
d)
Merge
25.

The above list is to be sorted using a bubble sort.

What will the list look like after the first iteration through the list.

a)
b)
c)
d)
26.

Identify the purpose of the above flowchart symbol

a)

Process

b)

Input/Output

c)

Sub-process

d)

Decision

27.

How many arrows should come out of a decision symbol in a flowchart?

a)

0

b)

1

c)

2

d)

3

28.

The following algorithm should take as input and add together two numbers, outputting the result.


Identify the correct algorithm.

a)
b)
c)
d)
29.

The following algorithm should take as input on number, and output the 12 times table for that number.


Identify the correct algorithm.

a)
b)
c)
d)
30.

The following algorithm should take as input two numbers, add them together, multiply the answer by 11, add 4, then divide by 2. It should output the result.


Identify the correct algorithm.

a)
b)
c)
d)
31.
An instruction that determines the order / flow of a program is known as a...
a)
Selection Statement
b)
Looping Statement
c)
Variable Statement
d)
Abstract Statement
32.
What are the two main categories of loop?
a)
Count & Event Controlled
b)
Count & For Controlled
c)
While & Event Controlled
d)
Event & Selection Controlled
33.
As the data set grows in size, linear search becomes more efficient than binary search. 
a)
True
b)
False
34.
What is the maximum number of comparisons a linear search algorithm could make while searching a 100 item list?
a)
50
b)
51
c)
100
d)
101
35.
How many comparisons would it take to find the value 7 in the following list using a linear search?
[1, 4, 7, 8, 5, 2, 9]
a)
3
b)
4
c)
2
d)
Not possible, list is out of order
36.
How many comparisons would it take to find the value 2 in the following list using a binary search?
[1, 4, 7, 8, 5, 2, 9]
a)
3
b)
2
c)
6
d)
Not possible, list is out of order
37.
How many comparisons would it take to find the value 2 in the following list using a binary search?
[1, 2, 4, 5, 7, 8, 9]
a)
1
b)
2
c)
3
d)
4
38.
code executed based on a condition being true 
a)
sequence 
b)
selection
c)
iteration
d)
variable
39.
code repeated / looped until a condition has been met or a set number of times 
a)
sequence
b)
selection
c)
iteration / repetition 
d)
variable 
40.
count controlled loop - code executed a given number of times is called 
a)
while loop
b)
for loop
c)
repeat loop
d)
if - else loop
41.
a loop repeated if the condition is true / false 
a)
while loop
b)
for loop
c)
repeat loop
d)
if - else loop
42.
a location in memory used to store data that can be changed is called a 
a)
constant
b)
value
c)
variable
d)
iteration 
43.
to solve a problem that requires the user to enter 10 numbers would use what type of iteration? 
a)
while loop
b)
for loop
c)
variable
d)
selection
44.
the user is asked to enter a number which must be below 100. what type of iteration would be used to check this? 
a)
for loop
b)
while loop
c)
check loop
d)
repeat loop
45.
The three types of flow you need to know are
a)
Sentence
Scanning
Information
b)
Sequence
Selection
Iteration
c)
Stepping
Choosing
Looping
d)
Spanning
Picking
Repeating
46.
A 'sequence' of code is...
a)
Code that repeats itself
b)
Code that includes some element of choice
c)
Code that executes step by step
d)
Code written in pseudocode
47.
'Selection' in code is...
a)
Code that repeats itself
b)
Code that includes some element of choice
c)
Code that executes step by step
d)
Code written in pseudocode
48.
'Iteration' in code is...
a)
Code that repeats itself
b)
Code that includes some element of choice
c)
Code that executes step by step
d)
Code written in pseudocode
49.
An IF statement is an example of 
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
50.
A WHILE statement is an example of 
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
51.
A FOR statement is an example of 
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
52.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
53.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
54.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
55.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
56.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
57.
This code is an example of ...
a)
Pseudocode
b)
Sequence
c)
Selection
d)
Iteration
58.
What is a series of memory locations for storing the same type of data?
a)
Array
b)
Function
c)
Sequence
d)
Iteration
59.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
60.
What command is this shape for?
a)
References another part of the program
b)
Data that is going in as input or coming out as output
c)
Processing something - a calculation or storing something into a variable
d)
Shows the direction of the program
61.
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
62.
Assume n1 = 10 ... n2 = 2 ... n3 = 2
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
63.
Assume n1 = 10 ... n2 = 20
What will be displayed as output?
a)
10
b)
20
64.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
65.
What is this ?
a)
Pseudocode
b)
Flow chart
c)
Syntax
66.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
What is the value of the variable?
a)
10
b)
=
c)
distanceToSchool
67.

What's missing from this part of a flowchart?

a)

An Arrow

b)

A Line

c)

A Square

d)

A Diamond

68.

WHAT IS A SUBPROGRAM?

a)

Inside the parentheses of a function

b)

The act of assigning a value to an argument for use by a function

c)

A variable used to send information to a function

d)

A collection of commands given a name that return a value or perform an action

69.

WHAT ARE THE REASONS FOR USING SUBPROGRAMS (ALIAS FUNCTIONS)?

a)

To build code that will be reused

b)

To simplify code

c)

To add comments

d)

Help us to organize longer programs

70.

WHAT ARE THE STEPS TO ADD A FUNCTION TO A PROGRAM?

a)

Print the function

b)

Define the function

c)

Add it above the main program

d)

Return the function

71.

The definition of a subprogram is...

a)

A program which returns a value at the end

b)

A piece of code that repeats

c)

A program within a program

d)

A program that allows data to be both input and output

72.

What is the correct term for the word in brackets shown in line 12?

a)

Argument

b)

Function

c)

Variable

d)

Parameter

73.

Leo wants to create a subroutine that will roll a dice. Which syntax is correct?

a)

def dice roll ():

b)

def diceroll ()

c)

def diceroll ():

d)

def diceroll []:

74.

What will the output of this program be when it is run?

a)

Nothing

b)

Hello, world

c)

It will generate an error

75.

Which of these is a list?

a)

fruit = ["apples", "oranges", "bananas"]

b)

fruit = "apples", "oranges", "bananas"

c)

fruit = {"apples", "oranges", "bananas"}

d)

fruit = ("apples", "oranges", "bananas")

76.
What is the position of the name 'Paula' in the following list:
names = ["Paul","Phillip","Paula","Phillipa"]
a)
0
b)
1
c)
2
d)
3
77.

How do i remove something from a list?

a)

variable.append()

b)

variable.delete()

c)

variable.remove()

d)

variable=(new variable)

78.

Which code would i use to add an item to a list?

a)

variable.add()

b)

variable.append()

c)

append.variable()

d)

add.variable()

79.

What would this out put? print(users[0][0])

a)

smith

b)

ben

c)

sam

d)

james

80.

What would this out put? print(users[2][1])

a)

error

b)

16

c)

brown

d)

smith

81.

What would this out put? print(users[0][2])

a)

23

b)

ben

c)

sam

d)

smith

82.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
83.

Which python operator means 'less than or equal to'?

a)

>=

b)

>

c)

<

d)

<=

84.

Which one of these is floor division?

a)

/

b)

//

c)

%

d)

None of the mentioned

85.

What is the answer of this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

86.

x = 5


print(x > 3 and x < 10)

a)

True

b)

False

87.

x = 10


print(x > 3 and x < 9)

a)

True

b)

False

88.

x = 5


print(x < 2 or x < 3)

a)

True

b)

False

89.

x = 5

y = 3


print(x != y)

a)

True

b)

False

90.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'A' be?

a)

1

b)

3

c)

5

d)

7

91.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'B' be?

a)

1

b)

3

c)

5

d)

7

92.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'C' be?

a)

1

b)

3

c)

8

d)

13

93.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'D' be?

a)

11

b)

13

c)

8

d)

1

94.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'E' be?

a)

3

b)

5

c)

8

d)

13

95.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'F' be?

a)

5

b)

8

c)

13

d)

18

96.

S (a)   errors are caused by incorrectly typed source code, e.g. print("Hello)

97.
Which statement best describes logic errors?
a)
An error in a program that causes it to produce incorrect ouputs but not a crash.
b)
An error in a program that causes it to crash.
c)
An error in the program caused by mis-spelt instructions.
d)
An error in a program caused by hardware failure.
98.
Which of these expressions will generate a logic error when the expected output is 10?
a)
answer = 2 + 3 * 2
b)
answer = (2 + 3) * 2
c)
answer = 2 + 3 x 2
d)
answer = {2 + 3} * 2
99.

Which type of error halts the program when a statement cannot be executed?

a)

Dynamic error

b)

Logic error

c)

Runtime error

d)

Syntax error

100.

What type of logic is this table showing:

a)

AND

b)

OR

c)

NOT

d)

NOR

101.

What type of logic is this table showing:

(a)  

102.

"I will take my umbrella only if it is both about to rain and I can find it"

This is an example of which type of logic?

a)

AND

b)

OR

c)

NOT

d)

NOR

103.

What type of logic is this table showing:

a)

AND

b)

OR

c)

NOR

d)

XOR

104.
What gate is this truth table for?
a)
AND
b)
OR
c)
NOT
d)
THE 
105.

Use the logic condition to find the value of X:


A or (B and C)

a)

True

b)

False

106.

Use the logic condition to find the value of Y:


A or (B or C)

a)

True

b)

False

107.
What rule would explain this input output table?
a)
The output is 3 times as much as the input.
b)
The input is 3 times as much as the output.
c)
The output is 8 times as much as the input.
d)
The input is 8 times as much as the output.
108.
The left column is the number of boxes. The right column is the total number of prizes. Which statement is true?
a)
The number of boxes is four times the number of prizes.
b)
The number of prizes is four times the number of boxes.
c)
The prizes are four more than the boxes.
d)
Not here.
109.

There is a syntax error with the code below. Please type it out correctly...


age=input(int("Please enter your age: ")

(a)  

110.

There is a syntax error with the code below. Please type it out correctly...


print ("Welcome to my program)

(a)