WorksheetsComputer Science Paper 2 Revision
Total questions: 120
Worksheet time: 1hrs 9mins
Select all the High-level programming languages ...
Python
C#
PHP
Assembly
Select all the Low-level programming code ...
Select all the types of program translator...
Compiler
Interpreter
Assembler
Parser
What is another name for the original untranslated program code?
Source code
Object code
Machine code
Assembly code
Which of these descriptions is of object code?
the translated source code, which could be machine code or a type of intermediary code such as bytecode
the code written by the programmer in the chosen programming language
binary codes representing the native instructions in the processor's instruction set
low-level code written using mnemonics that represent the machine instructions in a more meaningful form
Choose the BEST word to complete this sentence:
A high-level programming language lets the programmer write code with a large amount of _____________ from the actual machine instructions of the processor.
memory
lines
abstraction
complexity
Choose the BEST word to complete this sentence:
Assembly code uses short, simple codes called ___________ to represent the instructions of a processor's instruction set.
mnemonics
opcodes
acronyms
abbreviations
Choose all the reasons why programming in assembly code is difficult ....
There is only a small range of instructions available to achieve even the largest task
You have to decide how to represent and store ALL the data in the program, even WHERE it is stored in memory
Difficult to debug a program, as a buggy program usually just crashes the computer
Select all the TRUE statements about high-level languages...
They use recognizable English language keywords
They provide libraries of built-in functions for the programmer
Code must be translated into binary machine code before it can be executed
They are difficult to learn
Which form of translator works by translating the entire program code into a separate executable object code version?
Interpreter
Assembler
Compiler
Compressor
Which type of program translator works by translating and executing a program one line at a time?
Interpreter
Assembler
Compiler
Compressor
Which of these are fundamental control structures in any computer program?
branching
sequence
selection
repetition
iteration
A structured approach to programming which involves breaking a large program down into a number of smaller sub-programs is called ...
object orientation
algorithm
decomposition
abstraction
Which of these are valid methods of representing the steps of an algorithm? (select all that apply)
Flowchart
Pseudocode
Program code
English
Which of these are valid reasons for using subprograms to structure a program? (select all that apply)
Fewer lines of code
Can test subprograms independently
Avoids repetition of code
Different programmers can work on different parts of the program
Avoids need to use local variables
Which of these are recognized techniques of Computational Thinking? (select all that apply)
Debugging
Decomposition
Abstraction
Pattern recognition
Brute-force search
Abstraction is a recognised technique of Computational Thinking. Which of these is the best definition of abstraction?
Creating a set of logical steps that when followed achieve a particular task
Breaking a problem down into several layers of smaller and simpler subproblems
The process of removing or hiding unnecessary detail from a problem
Exploiting the recurrence of patterns in data to make processing more efficient
For which algorithm would it be best to use a conditional loop?
Finding largest number in a list
Calculating average of a list of numbers
Counting occurrences of an item in a list
Checking if an item is in a list
For which algorithm would it be best to use an unconditional loop?
Validating username and password
Adding up numbers in a list
Finding first occurrence of a number in a list
Validating user input for date of birth
What would the list [9, 6, 12, 7, 3, 16, 10] look like after one iteration of the Bubble sort algorithm (smallest to biggest)?
[6, 9, 7, 3, 12, 10, 16]
[3, 9, 6, 12, 7, 16, 10]
[3, 6, 7, 9, 10, 12, 16]
[9, 6, 12, 3, 7, 16, 10]
Which is the correct flowchart symbol for input/output?
An algorithm can be presented in which of the following formats?
Tree diagram
Flow chart
Histogram
Which of the following is in the data type of integer?
1
1.0
one
"1"
What does this shape represent in a flow chart?
general process
decision
input/output
subroutine
A local variable can only be used within its structure that they are declared in.
(a)
What will be the output if the input is 5?
The number is Even
The number is odd
What is the missing part of the program in to output hello world?
writeln
input
display
Which of the following is a definite loop?
FOR loop
while loop
repeat until loop
do loop
What will LEN("Happy") output ?
1
7
5
local variables have a local scope.
(a)
A variable is...
A memory location used to store a value that can change.
A memory location used to store a value that cannot change
A constant is...
A memory location used to store a value that can change.
A memory location used to store a value that cannot change
'Sequence' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
'Selection' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
'Iteration' means...
When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE
When lines of code loop e.g. WHILE, FOR
When lines of code runs one line after the other
A STRING is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
An INTEGER is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
A FLOAT is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
A BOOLEAN value is...
A TRUE/FALSE or YES/NO value
A word, or number not used in Maths.
A whole number
A number with a decimal point
The data value 'Steve' would be a...
STRING
INTEGER
FLOAT
BOOLEAN
The data value 'Phone Number: 07284 281837' would be a...
STRING
INTEGER
FLOAT
BOOLEAN
SQL statements always use...
WHERE
FROM
SELECT
SELECT
FROM
WHERE
FROM
SELECT
WHERE
SELECT
WHERE
FROM
The examples of maintainability below are... (select 3):
Comments in code
Indentation
Appropriate variable names
Testing an input and ensuring it is in the correct format or range
Input Sanitation
Input Validation
Input Creation
Input Testing
A syntax error means...
An error that still allows the code to run, however not as expected.
An error that prevents the code from running as it does not follow the code language rules.
A logic error means...
An error that still allows the code to run, however not as expected.
An error that prevents the code from running as it does not follow the code language rules.
The purpose of testing in programming is... (select 2):
To check that the program hits the user requirements
To save variables in the correct places in RAM
To add comments into the code
To check the code runs as expected.
Normal test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
Boundary test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
Erroneous test data is used to...
Test a value that is just inside/outside of what should/shouldn't be accepted.
Test a value that is expected in a program and should work.
Test a value that should be rejected by the program.
What logic gate is this?
AND
NOT
OR
What logic gate is this?
AND
NOT
OR
What logic gate is this?
AND
NOT
OR
DIV means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
MOD means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
^ means...
Dividing without including the remainder
Dividing, but only writing the remainder
Multiplying the number by itself
13 DIV 4 =
(a)
29 DIV 5 =
(a)
29 DIV 5 =
(a)
63 DIV 10 =
(a)
4^2 =
(a)
High-level language means...
A programming language that uses short and basic single words
A programming language that uses English-like words
1s and 0s - used by the CPU
Machine code means...
A programming language that uses short and basic single words
A programming language that uses English-like words
1s and 0s - used by the CPU
" score = input("Enter a number") "
is an example of...
High-level language
Low-level language
Machine code
INP 10
STA 12
OUT 28
is an example of...
High-level language
Low-level language
Machine code
1001 0101
0011 1111
0101 1110
is an example of...
High-level language
Low-level language
Machine code
What computer science concept stores information to be used later?
Conditional
Variable
Loop
Function
What computer science concept does something different depending on the situation?
Conditional
Variable
Loop
Function
What data type would store the value: Oranges
String
Float
Boolean
Integer
What symbol is used to multiply two numbers together?
+
=
*
/
Substring is used to?
Extract a portion of characters from a string
Print out a portion of a string
Remove the left characters by a certain amount
Allow you to change the upper case
What is the purpose of an array?
To store a value
To store multiple values of any type
To store programming code
To store multiple values of the same data type
Which of the following is the correct code to create an array to store some integers?
age = (2, 3, 1)
age = ["2", "3", "1"]
age = ["2" "3" "1"]
age = [2, 3, 1]
Describe what a function is?
A block a code that does not return a value
A block a code that returns a value
A block of code to store multiple values in
A type of iteration
Which of the following is not a boolean operator?
AND
OR
NOT
IS
The IF STATEMENT belongs to which programming construct?
Selection
Sequencing
Iteration
Data Structure
The REPEAT UNTIL OR DO WHILE STATEMENT belongs to which programming construct?
Selection
Sequencing
Iteration
Data Structure
Which of the following is classed as a counter controlled loop?
for loop
while loop
do until loop
If statement
Which of the following is classed as a condition based loop?
for loop
while loop
else statement
if statement
Which of the following is an algorithm for searching?
Linear
Bubble
Merge
Insertion
Which of the following is an algorithm for sorting?
Linear
Binary
Bubble
Selection
Which of the following can be used to help with maintainability?
Naming conventions for variables
Input validation
Authentication
Iterative Testing
Which is the meaning of input validation?
Checking whether the user can log in or not
Checking if an input value fits in with the rules
Checking if the input is maintainable
Checking if the input is correct for test data
Which of the SQL statements will correctly output one row of information?
SELECT * FROM teachers WHERE year group > 7
SELECT * FROM teachers WHERE subject = "Art" and subject = "Business"
SELECT * FROM teachers WHERE subject = "Art"
SELECT * FROM teachers WHERE name = "Mr Liu" or name = "Mr Prior"
Which of the SQL statements will correctly output year groups between 12 and 13?
SELECT * FROM teachers WHERE year group > 11 and year group < 14
SELECT * FROM teachers WHERE year group > 7
SELECT * FROM teachers WHERE year group > 12 and year group < 13
SELECT * FROM teachers WHERE year group > "11" and year group < "14"
IDE stands for?
Information Development Environment
Integrated Development Environment
Integrated Design Environment
Information Design Environment
The following is a truth table for which gate?
AND
OR
NOT
NAND
What type of algorithm is the following?
Bubble
Merge
Insertion
Binary
What is an array?
A set of programming statements grouped together under a single name that can be called to perform a task in a program
A positive or negative whole number that can be used with mathematical operators
A data structure containing several elements of the same data type
A variable or constant that is several characters in length
What is the main purpose of a function in programming?
To group programming statements together under a single name that can be called to perform a task in a program
To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions
To perform calculations using arithmetic operators
To store data in a file and retrieve data from a file
What is the purpose of the ROUND library routine in programming?
To generate a random number
To return the quotient (whole number part) of a division
To return the remainder of a division
To round a value to a given number of decimal places
What is the purpose of the RANDOM library routine in programming?
To return the remainder of a division
To generate a random number
To return the quotient (whole number part) of a division
To round a value to a given number of decimal places
What is the purpose of a loop in programming?
To store data in a file and retrieve data from a file
To repeat a set of instructions multiple times
To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions
To group programming statements together under a single name that can be called to perform a task in a program
What is an algorithm?
A sequence of instructions to solve a problem
It is pseudocode
It is a flowchart
It is a robot
What does this symbol represent?
Process
Input/Output
Start/End
Decision
What does this symbol represent?
Decision
Process
Input
End
4 5 9 6 2 7
4 5 6 2 7 9
4 5 2 6 7 9
SELECT *
_______ CUSTOMER;
If "num1=6" and "num2=9"
What is the output?
Num1 is largest
Num2 is largest
6 is largest
9 is largest
........................... is a simple method of showing an algorithm, using English-like words and mathematical operators that are set out to look like a program.
Structure diagrams
Pseudocode
Flowcharts
Top-Down Design
.............................. shows diagrammatically the steps required for a task (sub-system) and the order that they are to be performed. These steps together with the order are
called an ALGORITHM.
Structure diagrams
Pseudocode
Flowcharts
Top-Down Design
.................. ................... shows the design of a computer system in a hierarchical way, with each level giving a more detailed breakdown of the system into sub-systems.
Structure diagrams
Pseudocode
Flowcharts
Top-Down Design
.................. ................... is the breaking down of a computer system into a set of sub-systems, then breaking each sub-system down into a set of smaller sub-systems, until each sub-system just performs a single action.
Structure diagrams
Pseudocode
Flowcharts
Top-Down Design
A COMPUTER SYSTEM is made up of software, data, hardware, communications and .............;
People
Administrator
Operating System
Manager
Which one of the following is not a TEST DATA?
Big Data
Erroneous or Abnormal Data
Extreme Data
Boundary Data
Testing also needs to be done to prove that the solution does not give incorrect results. In order to do this, test data should be used that will be rejected as the values are not suitable.
Normal Data
Erroneous or Abnormal Data
Extreme Data
Boundary Data
This is used to establish where the largest and smallest values occur. It has 2 inputs
Normal Data
Erroneous or Abnormal Data
Extreme Data
Boundary Data
The name of the a field that identifies each record in a relational database.
Foreign Key
Primary Key
Keyless
None of the above
A collection of field in a database is:
Row
Record
Data
None of the above
A database with only one table is:
Database Management System
Flat file database
Spreadsheet
None of the above
It is a method of retrieving data from several tables and come up with a new table of the extracted fields.
Query
Table
Report
Forms
In a query, we use _____________ to get or filter the data from the database.
Criteria
Crickets
Datatypes
None of the above
A database is an
interesting collection of facts
a computer-based data storage technology
organised collection of data
a large disorganised bucket of data
Datatype to use for a phone number field.
Numeric
Boolean
Currency
Alphanumeric (short text)
Which of the following is a keyword that has pre-defined meaning?
(a) python
(b) data type
(c) global
(d) variable
