Font size
WorksheetsMr Swan's Mega Component 2 Final Revision Quiz
Total questions: 132
Worksheet time: 1hrs 12mins
Identify the search algorithm
Spotlight search
Binary search
Denary search
Next Item search
Identify the description of a linear search
Put the elements in order, start at the first item, check each item in turn
Put the elements in order, compare to the middle value, split the list in order and repeat
Elements do not need to be in order, check each item in turn
Elements do not need to be in order, compare to the middle value, split the list in order
and repeat
Identify the description of a binary search
Put the elements in order, start at the first item, check each item in turn
Start with elements in order, compare to the middle value, split the list in half and repeat
Elements do not need to be in order, check each item in turn
Elements do not need to be in order, compare to the middle value, split the list in order
and repeat
Which term is part of computational thinking?
Using a computer
Developing an algorithm to solve a problem
Making a computer use artificial intelligence
Google is computational thinking
Which of the following is not a component of computational thinking?
Abstraction
Typing
Decomposition
Algorithmic thinking
Define the term abstraction within computational thinking
Adding together numbers
Adding additional levels of detail to a problem to define it
Performing multiple calculations on a list of variables
Removing unnecessary details from a problem
Define the term decomposition within computational thinking
The breaking down of a program until it no longer exists
The creation of music that can be played on a computer
The breaking down of a problem into smaller problems
Adding detail to a solution to make it more complex
Identify which statement describes algorithmic thinking
Thinking like a computer
Writing binary numbers
Identifying the steps involved in solving a problem
Identifying what problems need to be solved
A linear search is to be performed on the list: 12, 6, 8, 1, 3. How many comparisons would it take to find the number 1?
1
2
3
4
A binary search is to be performed on the numbers 3, 5, 9, 10, 23. How many comparisons would it take to find the number 9?
1
2-3
4-5
9 can't be found
A binary search is to be performed on the following numbers: 1, 5, 10, 13, 48, 68, 100, 101. How many comparisons would it take to the find the number 101?
1
2
3-4
4-5
Identify the search performed by the following algorithm
Linear
Binary
Both linear and binary
Neither, it does not work
Which error may produce unexpected results in a program?
Linear
Sum
Logic
Syntax
Which error may stop a program from compiling?
Logic errors
Input errors
Run time errors
Syntax errors
Which of the following is not a sorting algorithm?
Bubble
Insertion
Binary
Merge
Which sorting algorithm is described by: moving through a set of data
repeatedly, compares adjacent elements and swaps any in the wrong order
Merge
Bubble
Insertion
None of these options
Split a list so that each value is in an individual list, then combine these
lists - two at a time - in the correct order, until all lists have been combined
Merge
Bubble
Insertion
None of these options
Which sorting algorithm is described by: take each item in turn,
compare it to the items in the sorted list and place it in the ordered position in the
sorted list?
Merge
Bubble
Insertion
None of these
The following two lists are to be merged using a merge sort. Which
element first goes into the new merged list? The lists are 0 indexed.
LIST 1: 2 4 8 9
LIST 2: 1 6 8 4
List 1 Item 0
List 2 Item 0
List 1 Item 1
List 2 Item 3
The following list is to be sorted using a bubble sort: 12 6 8 1 3
What will the list look like after the first iteration through the list?
6 8 1 3 12
6 12 1 8 3
1 3 6 8 12
6 8 1 12 3
Which sorting algorithm needs to go through the list repeatedly?
Filter
Bubble
Insertion
None of them do
Which sorting algorithm splits a list of items into individual values?
Merge
Bubble
Insertion
None of them do
Which sorting algorithm takes an item from the list, and puts it in the
correct place in a sorted list?
Merge
Bubble
Insertion
None of them do
Identify the correct definition for ‘algorithm'
A problem
A solution to a problem
The steps that are taken to solve a problem
The words to enter when typing
What is the purpose of this shape in a flowchart
Input/Output
Output
Start/Stop
Decision
Identify the purpose of the following flowchart symbol:
Input/Output
Sub program
Process
Decision
Identify the purpose of the following flowchart symbol:
Input/Output
Sub program
Process
Decision
Identify the purpose of the following flowchart symbol:
Process
Input/Output
Sub program
Decision
Identify the purpose of the following flowchart symbol:
Process
Input/Output
Sub program
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.
num1 = input("Enter the first number")
num2 – input("Enter the second number")
num3 = num1 + num2
print(num3)
num1 = input("Enter the first number")
num2 = input("Enter the second number")
num3 = num1 + num2
print(num3)
num1 = input("Enter the first number")
num3 = input("Enter the second number")
num3 = num1 + num2
print(num3)
num1 = input("Enter the first number")
num2 = input("Enter the second number")
num3 = num1 + num2
print(num2)
The following algorithm should take a number as input, and output the
12 times table for that number.
Identify the correct algorithm.
number = input("Enter a number")
for x = 1 to 12
print(number * x)
next x
number = input("Enter a number")
for x = 0 to 12
print(number * x)
next x
number = input("Enter a number")
for x = 1 to 12
print(number X x)
next x
number = input("Enter a number")
for x = 1 to 12
print(number * number)
next x
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.
number = input("Enter a number")
number = input("Enter the second number")
final = (((number + number) * 11) + 4) / 2
print (final)
number = input("Enter a number")
number2 = input("Enter the second number")
final = (((number + number2) 11) + 4) 2
print (final)
number = input("Enter a number")
number2 = input("Enter the second number")
final = number + number2 + 4 * 11 / 2
print (final)
number = input("Enter a number")
number2 = input("Enter the second number")
final = (((number + number2) * 11) + 4) / 2
print (final)
The following is not true about variable names
They must be descriptive
They must be in capital letters
They cannot start with numbers or contain spaces
They point to memory locations
Which of the following is a valid keyword for output?
MODIFY
EDIT
DISPLAY
INPUT
Consider the following expression: a = b. This means
a will always be equal to b
b is being renamed into a
The value of memory location a gets copied into memory location b
The value of memory location b gets copied into memory location a
Which of the following is not a valid data type?
Real
String
Character
Fraction
Whole numbers are best stored using this data type:
Boolean
Character
Integer
Real
This variable type can only have the values TRUE or FALSE:
Boolean
Character
Integer
String
Casting refers to:
Boolean algebra
Rounding of reals
Converting data to a different type
Printing out of the program’s results
The operator finds the remainder after integer division:
Integer division
Modulus
Division
Subtraction
The statement A OR B implies A and B are:
Integers
Strings
Booleans
Characters
This function calculates the length of a string:
UBOUND()
INDEX()
LEN()
COUNT()
The result of a logical comparison will be a...
Character
Boolean
Integer
String
Why would you use good code maintainability when writing a program?
Reduces the number of lines of code
Improves how quickly the program runs
Makes code easier to read and debug
All of these options
Variable scope refers to:
Variable data type
Variable identifier
Logic errors associated with a variable
The visibility of variables within a program
The advantages of parameter passing don’t include this:
The same subprogram can be reused in more cases
Makes it easier to use global variables
More flexible coding
Can cut down on the use of wasteful global variables
The main difference between procedures and functions is:
Procedures are usually longer and have more instructions
Functions use parameter passing, while procedures don’t
Functions are more difficult to debug
Functions may return values, while procedures don’t
If a variable appears within a sub program then it is likely to be...
A global variable
A local variable
A parameter variable
A constant
From this statement: a = getChoice() we can see that:
getChoice() is a function
getChoice() is a global variable
a is an array
getChoice() is a procedure
Trying to use a local variable from outside its scope will cause:
A global variable to be overwritten by it
A wrong procedure to run
An error when compiling
A logical error
Which of these statements is true?
Global variables waste memory
showResults(choice,cutoff) is a sub program
An array index is its length
Nested iteration structures can share the same counter variable
else if keyword is used when:
Selection needs to work with more than three choices
Selection needs to work with more than two choices
Using 'case select' statements
Using conditional loops
Identify a correct statement:
SELECT CASE is more popular then IF/ELSE IF/ELSE
We can’t have more than 5 levels of nested IF/ELSE IF/ELSE
SELECT CASE is the same concept as SWITCH
FOR loops are known as condition-controlled iteration
Identify an invalid expression:
else x = = 45 then
if x>9 and x<100 then
x = 10
procedure Test(a as integer)
When a for loop increases a counter by a number other than one, this is called:
Increment
Decrement
Stepping
Condition
For exiting for loops early we use:
Nested iteration
BREAK clause
HALT clause
Conditional loops
The following is not true about arrays:
All array elements have the same data type
Arrays have fixed size that can’t be easily changed during a program run
Arrays use an index
The use of iteration makes arrays less relevant
The following is not a correct statement involving arrays:
array Test[40]
array Test[4] = [56, 34, 89, 8]
array = Test[40]
array [ , ] = SPLIT(MID(“War and Peace”,2,5),”,”)
The following is true about record structures:
They must have an index
Fields are made up of records
Records contain variables that can have different data types
Record arrays are 2D arrays
SQL is used to work with files in this format:
Plain text
CSV
Proprietary binary
Spreadsheets
The following is true about SQL:
It has loops just like any other language
SQL is case sensitive
SQL is hard to read due to a lot of abbreviated keywords
SQL usually runs on top of another language
The purpose of SELECT * FROM Pupils WHERE Result >90 is:
To set every Pupil’s result to 90
To retrieve all the fields from the ‘Pupils’ table but only those where the result is 90
To retrieve all the fields from the ‘Pupils’ table but only those where the result is greater than 90
To retrieve all the fields from the ‘Pupils’ table but only those where the name is greater than 90
In SQL, the LIKE operator is used to:
Approve SQL statements before execution
Replace the WHERE statement
Deal with Boolean fields
Use partial matching when searching
Nested SELECT queries are used:
When Boolean operators get too complex
When retrieving data from multiple tables
When using partial matching
For validation and quality control
.endOfFile() could be used in:
To indicate the end of a line with a formatting delimiter
Conditional loops when writing to a file
Conditional loops when reading from a file
Destructive overwriting of the file’s data
The following is not a valid file open mode:
Delete
Append
Read
Write
The following is a correct way to write to a file:
myFile.readLine(variable)
myFile.writeLine(variable)
myFile.AppendAll(variable)
myFile.InsertAll(variable)
The most appropriate file mode for creating a daily log of entries:
Read
Write
Append
Close
The following is a valid way to write the contents of a 2D array to a text file:
Concatenate each row to a string with commas and then concatenate all rows with new line characters
Split the text file into an array, copy all elements to this array
Use SQL to convert 2D array to records first
Which of these is not a method for ensuring a program is robust?
Keeping passwords safe
Data Validation
Authentication
What is data validation?
Checking that the data entered is wrong
Checking that the data entered is correct
Checking that the data entered is sensible or reasonable
Which of these authentication methods is a common method of authenticating
access to online accounts?
Voice Activation
Biometrics
Key Card
2 factor authentication
Which is these IS NOT an example of validation?
Checking the number entered is 2 digits
Double Entry
Use of a Lookup table
Use of a presence check
What does a range check do?
Checks data is of the right type
Checks the data is between set values
Sorts numbers into ascending order
Checks that the data is in the correct format
A program asks the user to enter their first name. Which is a likely example of Valid
data?
00000
Sarah
S4r4h
Sarah Jones
Which one of these would not help prevent unauthorised access?
Limiting the number of login attempts
Requesting a password and user name
Two factor authentication
Not validating the data entry
What is an example of maintainability?
Checking programs work
Making your code easy to follow, for example, with comments
Testing a program for errors
Training staff to use the program correctly
Which of these is not a method for authenticating a user?
Biometrics
Password and Username
Finger print scanner
Encryption
Why are comments used in a program?
It is required to make the program run
Comments pad out the program and make it look more professional
To help someone follow what is happening in your code
To help security in the code
When should comments be used within a program?
To help describe what code and structures are designed to do
To remind the developer of other tasks to complete in the code
To show tests must be carried out on the code
Every line, so that you know exactly what is happening
What is defensive programming design?
Making your code/program error free
Creating code that is easy to use and understand
A method of ensuring that your code is not misused
Adding comments to a program
Which of the following is a bad example of a variable name?
Customer_Number
variableA
customerNumber
Cust_No
A program has 100 lines of code. What could the programmer use to aid code
maintenance?
Add more variable names to the code
Use authentication
Ensure they use suitable program comments
Delete the spaces between lines of code
How do sub programs improve maintainability?
By returning a value
Gives the program structure
Carrying out a set of instructions
Calling procedure name
A program requires the user to enter their year of birth. What two techniques
could the programmer consider using? (Pick 2 answers)
Data validation
Maintainability
Input verification
Authentication
When is terminal testing carried out?
Before you start
After all code has been written
During the project
After the design section
Which of these is NOT a feature of a test plan?
The data entered
The type of test data
The lines of code you are testing
The expected outcome
The result of the test
When is a runtime error identified?
After the program is executed
Before a program runs
While the program runs
Which of these statements contains a syntax error?
print("hello")
print("Hello")
print("hello)
print("HELLO")
What is iterative testing?
Testing completed after an error is found
Random tests on a computer program
Tests used to inform development
Tests only completed once all code is written
When a program runs it asks the user to enter their age. Which of these would be
used to test for invalid data entry?
44
18
456
Forty Five
Which of these is not used in a test plan?
Valid Data
Boundary Data
Erroneous Data
Average Data
Which of these are not a real type of data used in testing? (Pick 2 options)
Valid Data
Personal Data
Erroneous Data
Real Data
Boundary Value
What is the generic name given to an error found in code?
Bugs
Validation
Syntax
Compilers
Testing while programming is called?
Stop-Start testing
Coder testing
Terminal testing
Iterative testing
What is a breakpoint?
The point at which a program breaks
A feature within an IDE to stop a program at a certain line
The point in a program where an error is found
The point at which the coder is frustrated with the program
Which of these is appropriate data for a range test for a youth club for people
aged 14-18?
10 – 20 years
16 – 19 years
13 – 19 years
13 – 23 years
Which of these is should be accepted for an integer variable?
18.6
99
Twenty-Five
17 years 5 months
What is the purpose of testing?
To identify errors
To identify issues that may occur when a customer uses the program
To test the security of the program
All of these options
What is the output of an OR gate if the inputs are 1 and 0?
0
1
OFF
2
What is the output of an AND gate if the inputs are 1 and 0?
ON
2
1
0
What is the output of a NOT gate if the input is 0?
1
0
OFF
2
A NOT gate has:
Two inputs and one output
One input and one output
One input and two outputs
Two inputs and two outputs
A OR gate has:
Two inputs and one output
One input and one output
One input and two outputs
Two inputs and two outputs
The output of a logic gate can be in one of two:
Gates
States
Inputs
Outputs
A logic state can only be:
On or 1
Off or 0
1 or 0
In and Out
The output of a (a) gate is only 1 when both inputs are 1:
A NAND gate is the combination of which two gates:
OR and AND
AND and NOT
NOT and OR
OR and NAND
Machine code is used in which generation of a programming language?
1st
2nd
3rd
4th
Which language translator is needed for the first generation?
Compiler
Interpreter
No Translator
Language Translator
Which of these is an example of a low-level language?
Delphi
Assembly
Basic
C#
Which language translators are used with the third generation? (Pick 2 options)
Compiler
Interpreter
No Translator
Language Translator
Which generation would create the fastest code to execute?
1st
2nd
3rd
4th
Which generation would be easier to program for a programmer?
1st
2nd
3rd
4th
An advantage of programming in a high-level programming language is:
Uses natural language and so can be easier to read/understand
Useful for device drivers
The final file size is smaller
Programs run more quickly at runtime
What sort of relationship are low-level languages said to have with high-level
languages?
One to One (One high level instruction is equivalent to one low level)
One to Two (For every high level instruction there are two low level instructions)
One to many (For every high level instruction there are many low level instructions)
Many to One (Many high level instructions translate into one low level instruction)
Software program which optimizes code, ready for execution:
Language Translator
Compiler
Interpreter
Converts instructions in a programming language to a single executable file:
Compiler
Interpreter
Which translator stops when it encounters an error?
Compiler
Interpreter
Which translator produces Object Code and an Error Report listing the errors
found?
Compiler
Interpreter
What is meant by source code?
The final executable program
The code written by the programmer
The additional information about errors
Code relating to sources of information on the Internet
Nearly all IDEs will have this to manipulate source code
Text Editor
Debugger
Compiler
Helps identify and fix errors in code
Text Editor
Debugger
Compiler
Translates source code from a high-level language to a lower level language
Text Editor
Debugger
Compiler
What do you use to write source code?
Text Editor
Debugger
Compiler
What would I use to set a breakpoint?
Text Editor
Debugger
Compiler
Which one would I be using if I had syntax highlighting?
Text Editor
Debugger
Compiler
Which feature translates the source code in the code editor?
Text Editor
Debugger
Compiler
Are IDEs open source?
Yes
No
Some are open source, some are not
Tick all, that are features of an IDE?
Debug Tool
Editor
Project Explorer /Navigation Pane
What is a debugger?
The final executable program
The code written by the programmer
Assists in the detection and correction of errors
Translates code
