Font size
WorksheetsMOCK Exam 2
Total questions: 80
Worksheet time: 42mins
Which type of lists or data sets are linear searching algorithms used for?
Unsorted lists or data sets
Sorted lists or data sets
Sorted or Unsorted lists or data sets
Select the best description to explain what a binary search algorithm is.
Put the elements in order, check each item in turn.
Put the elements in order, compare with 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
4 5 9 6 2 7
4 5 6 2 7 9
4 5 2 6 7 9
4 8 6 2 5 7
4 8 6 2 5 7
4 6 8 2 5 7
Define the term computational thinking
Using a computer
Developing an algorithm to solve a problem
Making a computer use artificial intelligence
Google is computational thinking
Solving a problem using a computer
Q9: This variable type can only have True or False values
Boolean
Integer
String
Character
Which line of code lets us input a number?
int(input("enter a number"))
input("Enter a number")
str(input("Enter a number"))
import random
6.Complete this sentence: ……………………… is used to execute a particular set of statements repeatedly until a condition is satisfied.
Sequence
Iteration
Selection
All of the above
Q4: Which of the following is a valid keyword for output?
SHOW
DISPLAY
INPUT
In an assignment operation, what appears on the right hand side ?
Variable identifier / name
The assignment operator (=)
data to be assigned
Quotation marks around data implies the data type is?
an integer
a string
a Boolean
a real
Casting refers to
joining two strings together
Converting one data type to another
The operator used to divide and returns a INTEGER answer is?
DIV (//)
MOD (%)
Division (/)
**
Which line of code lets us input a number?
x = int(input("enter a number")
x = input("enter a number")
x = str(input("Enter a number"))
x = int(input("enter a number"))
What is the name of the sub-routine?
say_my_name
my_name
name
def
What is the name of the parameter?
say_my_name
my_name
name
def
There are none
Which of these statements apply to the term 'variable'
A named memory location that stores a value
value cannot change whilst the program is running
value can change whilst the program is running
What is the name given to this common convention for variable names - FirstName
Camel case
Snake case
Dog case
Fish case
What does the arithmetic operator do in this code: print(5**2)
Division returning a real / float
Division returning an integer
Division returning the remainder
Multiplying a number by itself (to the power of)
What is the function of the operator == ?
Equal to: Checks if two values are equal
Not equal to: Checks if two values are not equal
Assignment: Assigns data to a variable
Greater than or equal to: Checks to see if one value is greater than or equal to another
Which of the following key terms are evidenced in the image?
Function
Procedure
Parameter
Variable
Iteration
Concatenation refers to
joining two strings together
Converting one data type to another
Which of these statements apply to the term 'constant'
A named memory location that stores a value
value cannot change whilst the program is running
value can change whilst the program is running
8 != 9 AND 20>3
True
False
NOT ( 7*2 == 14 )
True
False
What would the SQL query pictured do?
Find all the men
Find all of the female writers
Find all of Elgar's friends
Find all the male writers
Find all the fish
Which of these is not a method for ensuring a program is robust?
Keeping passwords safe
Data Validation
Authentication
Data Sanitisation
Testing
Why is code indented?
To improve structure of code
To show which lines of code are related to others
To make it easier to read
All of the above
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
When should comments be used within a program?
To help describe what certain lines of code & structures are expected to do
To remind the developer of when lunch is
To include what tests must be carried out on the code
Every line, so that you know exactly what is happening
When is terminal testing carried out?
Before you start
At the end
During the project
After the design section
What is iterative testing?
Testing completed after an error is found
Tests which are planned
Tests completed as the program is being coded
A program runs & asks the user to enter their age. Which is erroneous test data?
44
1
97
Forty Five
Which validation check makes sure that the data field cannot be left empty.
Presence check
List check
Range check
Type check
Format check
Which method of validation checks that only certain data types can be used e.g. string/int?
Presence check
List check
Range check
Type check
Format check
Which validation check makes sure that the user enters the correct number of characters required.
Presence check
List check
Length check
Type check
Format check
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 computer is made up of.......
A motherboard, keyboard, mouse and joystick
Transistors which act as switches with two states : on and off
Both inputs must be true for the output to be true
AND gate
OR gate
NOT gate
NOR gate
NAND gate
Either inputs or both can be true for output to be true
OR gate
AND gate
NOT gate
NOR gate
NAND gate
The symbol for NOT in a Boolean expression.
¬
^
v
The symbol for AND in a Boolean expression.
^
v
¬
The symbol for OR in a Boolean expression.
v
^
¬
Which logic gate is represented by the truth table shown here?
AND
OR
NOT
Which logic gate is represented by the truth table shown here?:
AND
OR
NOT
What is assembly code?
Another name for machine code
High-level programming language
Low-level programming language
sit in forms, be quiet, listen to Miss Boyd
What does a translator do?
Swaps between different high-level languages
Swaps between different machine code types
Converts pseudocode to machine code
Converts high level language to machine code
Which of the following is NOT a translator?
Assembler
Compiler
Interpreter
Executable
It translates the whole program into machine code before it runs.
Assembler
Compiler
Interpreter
Linker
It translates code into machine code instruction by instruction.
Assembler
Compiler
Interpreter
Linker
It translates assembly code into machine code.
Assembler
Compiler
Interpreter
Linker
Embedded systems use
High Level Code
Machine Code
Assembly Language
Low Level Language
IDE's contain a ________ environment which allows you to execute the program
runtime
outtime
walktime
linetime
Which of the following is NOT part of an IDE?
Debugger
Communicator
Code Editor
Run-time environment
What does IDE stand for?
Internal Development Environment
Integrated Design Environment
I Dance Energetically
Integrated Development Environment
