Font size
Worksheets1.1. Problem Solving: Algorithms_CS (1-9) Edexcel
Total questions: 110
Worksheet time: 1hrs 23mins
A linear search is to be performed on the list above.
How many comparisons would it take to find the number 1?
1
2
3
4
A binary search is to be performed on the list above.
How many comparisons would it take to find the number 9?
0-1
2-3
4-5
It can't find the number 9
A binary search is to be performed on the list above.
How many comparisons would it take to the find the number 101?
0-1
1-2
3-4
4-5
Identify the search performed by the above algorithm
Linear
Binary
Both linear and binary
Neither, it does not work
The above list is to be sorted using a bubble sort.
What will the list look like after the first iteration through the list.
Identify the purpose of the above flowchart symbol
Process
Input/Output
Sub-process
Decision
How many arrows should come out of a decision symbol in a flowchart?
0
1
2
3
The following algorithm should take as input and add together two numbers, outputting the result.
Identify the correct algorithm.
The following algorithm should take as input on number, and output the 12 times table for that number.
Identify the correct algorithm.
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.
[1, 4, 7, 8, 5, 2, 9]
[1, 4, 7, 8, 5, 2, 9]
[1, 2, 4, 5, 7, 8, 9]
Scanning
Information
Selection
Iteration
Choosing
Looping
Picking
Repeating
What will be displayed as output?
What will be displayed as output?
Yes
distanceToSchool = 10
What is the value of the variable?
What's missing from this part of a flowchart?
An Arrow
A Line
A Square
A Diamond
WHAT IS A SUBPROGRAM?
Inside the parentheses of a function
The act of assigning a value to an argument for use by a function
A variable used to send information to a function
A collection of commands given a name that return a value or perform an action
WHAT ARE THE REASONS FOR USING SUBPROGRAMS (ALIAS FUNCTIONS)?
To build code that will be reused
To simplify code
To add comments
Help us to organize longer programs
WHAT ARE THE STEPS TO ADD A FUNCTION TO A PROGRAM?
Print the function
Define the function
Add it above the main program
Return the function
The definition of a subprogram is...
A program which returns a value at the end
A piece of code that repeats
A program within a program
A program that allows data to be both input and output
What is the correct term for the word in brackets shown in line 12?
Argument
Function
Variable
Parameter
Leo wants to create a subroutine that will roll a dice. Which syntax is correct?
def dice roll ():
def diceroll ()
def diceroll ():
def diceroll []:
What will the output of this program be when it is run?
Nothing
Hello, world
It will generate an error
Which of these is a list?
fruit = ["apples", "oranges", "bananas"]
fruit = "apples", "oranges", "bananas"
fruit = {"apples", "oranges", "bananas"}
fruit = ("apples", "oranges", "bananas")
names = ["Paul","Phillip","Paula","Phillipa"]
How do i remove something from a list?
variable.append()
variable.delete()
variable.remove()
variable=(new variable)
Which code would i use to add an item to a list?
variable.add()
variable.append()
append.variable()
add.variable()
What would this out put? print(users[0][0])
smith
ben
sam
james
What would this out put? print(users[2][1])
error
16
brown
smith
What would this out put? print(users[0][2])
23
ben
sam
smith
Which python operator means 'less than or equal to'?
>=
>
<
<=
Which one of these is floor division?
/
//
%
None of the mentioned
What is the answer of this expression, 22 % 3 is?
7
1
0
5
x = 5
print(x > 3 and x < 10)
True
False
x = 10
print(x > 3 and x < 9)
True
False
x = 5
print(x < 2 or x < 3)
True
False
x = 5
y = 3
print(x != y)
True
False
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'A' be?
1
3
5
7
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'B' be?
1
3
5
7
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'C' be?
1
3
8
13
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'D' be?
11
13
8
1
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'E' be?
3
5
8
13
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'F' be?
5
8
13
18
S (a) errors are caused by incorrectly typed source code, e.g. print("Hello)
Which type of error halts the program when a statement cannot be executed?
Dynamic error
Logic error
Runtime error
Syntax error
What type of logic is this table showing:
AND
OR
NOT
NOR
What type of logic is this table showing:
(a)
"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?
AND
OR
NOT
NOR
What type of logic is this table showing:
AND
OR
NOR
XOR
Use the logic condition to find the value of X:
A or (B and C)
True
False
Use the logic condition to find the value of Y:
A or (B or C)
True
False
There is a syntax error with the code below. Please type it out correctly...
age=input(int("Please enter your age: ")
(a)
There is a syntax error with the code below. Please type it out correctly...
print ("Welcome to my program)
(a)
