Font size
WorksheetsOCR Pretest Section 2
Total questions: 120
Worksheet time: 1hrs 2mins
Which of the following is not done by abstraction?
Identifies essential details
Disregards non-essential information
Breaks the problem down into smaller tasks
Which of the following is not done by decomposition?
Allows multiple people to work on the problem together
Disregards non-essential information
Breaks the problem down into smaller tasks
When drawing a dog, which of the following characteristics is non-essential?
Dogs have 4 paws
Dogs have fur
Dogs have brown fur
When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?
Number of doors
Number of walls
Number of wall paintings
One advantage of abstraction is that it means no mistakes can be made
True
False
You could use abstraction to replace specific objects with simple shapes
True
False
This is a good example of decomposition
Sit down
Do homework
True
False
Decomposition allows each task to become _______
More manageable
Easier
Quicker
Decomposition allows the entire task to be completed as _____
A Team
A Whole
Quickly as possible
Abstraction and Decomposition are separate concepts, you would usually choose to do either one or the other
True
False
It is always necessary to decompose a task
True
False
Abstraction and Decomposition are examples of...
Computational Thinking
Algorithmic Thinking
Computer Science
Logical Reasoning
What is pattern recognition?
Breaking down a complex problem into smaller problems
Looking for similarities among and within problems
Building models from patterns
Why do we need to look for patterns in problems?
Patterns make it easier for us to solve complex problems
We don't need to look for patterns
Patterns make it more difficult complex problems
If you don't look for patterns in a problem, your solution might be _____
Wrong
Inefficient
Too slow
Identifying the steps involved in solving a problem
Abstraction
Decomposition
Pattern Recognition
Algorithmic Thinking
Looking for similarities and trends within a problem
Abstraction
Decomposition
Pattern recognition
Algorithmic Thinking
What is a flowchart?
A visual representation of an algorithm.
A diagram that shows abstraction.
A series of shapes.
A school database has lots of information on students, the data manager needs to use abstraction. What data should she leave out?
Age
Guardian's phone numbers
Classes
Eye colour
What is an algorithm?
Patterns and trends used to solve a problem
A set of step-by-step instructions to resolve a problem
A programming language
What are algorithms used for?
To plan out the solution to a problem
As a platform to program a solution
To test a solution to a problem
Which of these is NOT an algorithm?
Following recipe instructions
Working out how an engine works
Tying your shoelaces
Making a cup of coffee
What does an algorithm need to be (choose more than 1)
Clear instructions
Exact
Easy to understand
Complex
When can an algorithm be used?
Only with computers
For programming
To design a solution to any problem
What is decomposition?
Searches the computer's memory for data
Repeats a program
Getting small part of a problem and adding them together
Breaking down a complex problem
What is abstraction?
Removal of certain details, keeping relevant the information
Stores data in a program for retrieval
Freedom from representing art
Detects errors while program is running
If it is AFTER 7am, what do you need to do?
Take the bus
Take the subway
Check the time
Leave home
What should be considered when designing an algorithm?
If there is more than one way to solve the problem
If the correct hardware is being used
If the correct software is being used
You are at the yellow arrow, pointing in the direction indicated. How would you move to fill in the 2 black squares?
Straight, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 1, Fill Square
Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 1, Fill Square
Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn right, Straight x 1, Fill Square
Straight x 2, Turn right, Straight x 1, Fill Square, Straight x 2, Turn left, Straight x 2, Fill Square
What is an algorithm?
A flowchart
Step by step instructions used to solve a problem
A decision
A flowchart or pseudocode
What are the three algorithm constructs?
Sequence, Selection, Iteration
Input, Process, Output
Input/output, decision, terminator
Loop, input/output, process
What is the difference between a flowchart and pseudocode?
A flowchart is diagrammatic whilst pseudocode is written in a programming language
A flowchart is textual but pseudocode is diagrammatic
A flowchart is a diagrammatic description of an algorithm whilst pseudocode is a textual description of an algorithm
A flowchart and pseudocode are the same thing
In a flowchart an input or output instruction is represented by:
A rectangle
A rhombus
A parallelogram
A circle
In a flowchart a calculation (process) is represented by:
A rectangle
A rhombus
A parallelogram
A circle
In a flowchart a decision (selection) is represented by:
A rectangle
A rhombus
A parallelogram
A circle
An algorithm asks a user to enter their age, the age is read into the system and the system outputs a 'Thank You' message.
This is an example of which of the algorithm construct?
Decision (Selection)
Loop (Iteration)
Order (Sequence)
All of the above
An Algorithm asks the user to enter their scores for 5 different tests.
This is an example of which of the algorithm constructs?
Decision (Selection)
Loop (Iteration)
Order (Sequence)
All of the above
An Algorithm asks the user to enter their gender (M or F) and prints out a different comment depending on what they entered.
This is an example of which of the algorithm constructs?
Decision (Selection)
Loop (Iteration)
Order (Sequence)
All of the above
What is a "Variable" ?
A value that can be changed and manipulated as an algorithm is running
A value that cannot be changed and manipulated as an algorithm is running
Variables are assigned an identifier. The identifier should be:
not too long
have a sensible name
not start with a number
not start with a capital letter
all of the above
firstName is and example of what commonly used way to name a variable
camelcase
snakecase
linecase
hillcase
first_name is and example of what commonly used way to name a variable
camelcase
snakecase
linecase
hillcase
What type of operators are + - * / DIV MOD ^
Arithmetic
Relational
Booleon
What type of operators are == != < > <= >=
Arithmetic
Relational
Booleon
What type of operators are AND OR NOT
Arithmetic
Relational
Booleon
Booleon operators are also know as:
Logical operators
Combination operators
Algorithmic operators
Flow operators
This an example of:
a nested if
a combined if
a multiple if
a sequence if
Here is an algorithm used to calculate whether a worker should get a bonus.
How much bonus would they get if their WagesEarned = 200
50
250
200
150
Yes
19
"D"
The following is true about Top-down approach
The Main procedure is defined first, with other subs to follow
The detailed list of all operations is drawn up first, before we can start planning
We start from the top of the program and complete the algorithm by getting to the bottom of it
Functions can’t be included as they can’t be directly called by procedures.
Structured code has the following benefit
Reduces the number of lines of code
Improves efficiency
Makes code easier to read and debug
All of these options are true
Variable scope refers to
Variable data type
Variable identifier
Logic errors associated with a variable
Different use of global and local variables
The advantages of parameter passing don’t include this
The same subprogram can be reused in more cases
Parameter passing 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 return values, while procedures don’t
When a variable first appears outside any subprograms
It is a global variable
It is a local variable
It is a parameter variable
It is not a valid variable
Converting procedures to functions usually causes these effects
Shorter code
Slows the program down
Reduction of the number of global variables, more parameter passing
Makes it more difficult to use selection
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
A crash with a report “Unknown variable”
A logical error
Identify a correct statement:
Global variables waste memory
showResults(choice,cutoff) is a function
An array index is its length
Nested iteration structures can share the same counter variable
ELSE IF keyword is used when
Our selection needs to work with more than three choices
Our selection needs to work with more than two choices
SELECT CASE/SWITCH statement is not available
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
In the nested selection statements
The inside selection structure gets executed first
The outside selection structure gets executed first
AND and OR are to be avoided
Integers must be used instead of Booleans
The flowchart shape for selection is
Parallelogram
Square
Diamond
Rounded rectangle
Identify an invalid expression
ELSE x=45 THEN
IF x>9 and x<100 THEN
Any FOR loop can be rewritten as a WHILE loop
PROCEDURE Test(a AS INTEGER)
When a FOR loop increments 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
Names[LEN(Names)] is the last element of the array Names
The use of iteration makes arrays less relevant
The following is not a correct statement involving arrays
ARRAY Test[40]
ARRAY Test[56,34,89,8]
ARRAY:= Test[40]
NewArray:=SPLIT(MID(“War and Peace”,2,5),”,”)
The following is not a correct statement involving arrays
J:=Pupils[5,8]
Nums[i,j]:=Nums[i-1,j]
Nums[i,j]:=Nums[i-1]
B:=getChoices(45)
5.23 would be stored as:
Integer
Real Number
String
Character
Boolean
What is >= ?
What is < ?
Comparison Operators
What is A > B?
A greater than B
A less than B
Greater than or equal to
Less than or equal to
What is <= ?
What is && ?
What is != ?
What is == ?
Arithmetic Operators What is a/c ?
Addition
Subtraction
Division
Modulo
5 would be stored as:
Integer
Real Number
String
Character
Boolean
M / F would be stored as:
Integer
Real Number
String
Character
Boolean
"The cat sat on the mat" would be stored as:
Integer
Real Number
String
Character
Boolean
Conversion of one data type to another e.g.
age = "30" # this is a string!
YearsOld=int(age)
is known as...?
Declaring
Assigning (or Assignment)
Casting
Concatenation
What is selection?
Instructions are only executed if a TRUE or FALSE condition is met
The program chooses to execute whatever it pleases
Instructions are executed one at a time in list order
Instructions are repeated until a condition is met, creating a loop
What is sequencing?
Instructions are only executed if a TRUE or FALSE condition is met
The program chooses to execute whatever it pleases
Instructions are executed one at a time in list order
Instructions are repeated until a condition is met, creating a loop
What is iteration?
Instructions are only executed if a TRUE or FALSE condition is met
The program chooses to execute whatever it pleases
Instructions are executed one at a time in list order
Instructions are repeated until a condition is met, creating a loop
AND, OR, NOT are all examples of what?
Boolean Operators
Arithmetic Operators
Strings
Data Types
What does AND do?
Both conditions must be met to return true
Only one condition must be met to return true
No conditions must be met to return true
Inverses the condition
What does OR do?
Both conditions must be met to return true
Only one condition must be met to return true
No conditions must be met to return true
Inverses the condition
What does NOT do?
Both conditions must be met to return true
Only one condition must be met to return true
No conditions must be met to return true
Inverses the condition
What does the following code do?
print("find me paper")
Prints a message to the screen
Sends a message to the nearest printer
Iterates through a loop
Takes an input from the user
What does the following code do?
if goodGrades == TRUE then
print("Congratulations!")
end if
If a condition is met, prints a message to the screen
Prints a message
Creates a loop
Take an input from the user
What does this code do?
while answerIsWrong == TRUE
print("What is the answer?")
Creates a loop
Takes an input from the user
Creates a string
Calculates Pi
High level languages are easy to understand...
True
False
Is used to translate Assembly Code
Assembler
Compiler
Interpreter
Is not used to translate High Level Languages
Assembler
Compiler
Interpreter
Translates entire source code in one go
Assembler
Compiler
Interpreter
Which language translator is used for Low Level Languages?
Assembler
Compiler
Interpreter
Which language translator is used at the end of development?
Assembler
Compiler
Interpreter
Which language translator is used during the development of a program?
Assembler
Compiler
Interpreter
Which language translator produces Object Code and an Error Report?
Assembler
Compiler
Interpreter
Which language translator does not convert source code into machine code?
Assembler
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
What generation of programming language is Machine Code
1st Generation
2nd Generation
4th Generation
3rd Generation
What type of language translator is needed for the 1st Generation to the CPU
Compiler
No translator needed
Assembler
Interpreter
Why would you program in a low level language.
Easier to understand
Uses less code
Makes programs with small file sizes
Simple to de-bug
One advantage of programming in a high level language is.
Eliminates bugs
Easier to understand
Executes faster than other levels
Useful for programming device drivers
Define the relationship between low and high level languages.
One to One (One high level instruction = one low level)
One to Two (Each high level instruction has two low level instructions)
One to Many (Each high level instruction has many low level instructions)
Many to One (Many high level instruction has only one low level instruction)
What is used to translate assembly code.
Assembler
Compiler
Interpreter
Router
What is NOT used when translating high level languages
Assembler
Compiler
Router
Interpreter
What is used to translate the entire source code in one go.
Assembler
Compiler
Interpreter
Router
On fully developed code, what translator is used at the end before publishing.
Assembler
Compiler
Interpreter
Editor
