Font size
WorksheetsComputer Science Paper 2 AMH
Total questions: 120
Worksheet time: 1hrs 2mins
Which of these are logic gates?
AND
OR
NOT
IF
ELSE
What is the output of an AND gate if its inputs are 1 and 1?
1
0
What is the output of an AND gate if its inputs are 1 and 0?
1
0
What is the output of an OR gate if its inputs are 0 and 1?
1
0
What is the output of an OR gate if its inputs are 0 and 0?
1
0
Which logic gate does this symbol represent?
AND
OR
NOT
IF
ELSE
Which logic gate does this symbol represent?
AND
OR
NOT
IF
ELSE
What is the function of a NOT gate?
Inverts its input
Outputs 1 if both inputs are 1
Prevents errors
Outputs 0 if both inputs are 0
What is the output Y of this logic cricuit if A = 1, B = 1, and C = 1
0
1
What is the output Z of this logic cricuit if A = 1 and B = 1
0
1
True or False:
NOT gates can only have one input
True
False
What type of logic gate is this table showing?
AND
OR
NOT
What type of logic gate is this table showing?
AND
OR
NOT
Which logic gate is this?
AND
OR
NOT
Which logic gate is this?
AND
OR
NOT
Which logic gate is this?
AND
NOT
OR
What will this gate's output be?
0
1
What will this gate's output be?
0
1
What will this gate's output be?
0
1
What will this gate's output be?
0
1
How many different combinations of 1 and 0 are possible with 2 bits?
2
4
6
8
What is the Logic Expression for this circuit?
Z = NOT (A AND B)
Z = NOT (A OR B)
Z = (NOT A) AND B
Z = (NOT A) OR B
True or False:
NOT gates output the opposite of the input
True
False
Which of the following is NOT a variable?
Number
Count
userGuess
input
On line 5, + is a:
Comparison operatior
Boolean Operator
Assignment Operator
Arithmetic operator
On which line will the user be asked to input a number?
1
3
2
4
On which line is the variable count first initialised?
1
5
2
7
On which line is iteration used?
5
7
6
3
On line 6, == is a:
Arithmentic operator
Assignment Operator
Comparison Operator
Boolean Operator
On which line is the variable count incremented by 1?
1
7
5
2
On line 2, = is a
Comparison Operator
Boolean Operator
Arithmentic Operator
Assignment Operator
On which line is selection used?
6
3
10
4
On which line is a concatenation used?
1
7
4
11
On which line does a sequence start?
1
10
4
9
What is the data type of count?
float
string
integer
Boolean
what type of variable is UserGuess
Float
Integer
String
Boolean
What is the data type of i?
Float
Integer
String
Boolean
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
A boolean is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
An integer is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
A real is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
A string is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
Pick the correct line which creates a variable called 'name' which is a string.
name is string
string = name
name = string
string is name
The best data type for an age is...
integer
real
string
boolean
The best data type for a name is...
integer
real
string
boolean
The best data type for an average is...
integer
real
string
boolean
The best data type for a counter is...
integer
real
string
boolean
8.2 is a...
integer
real
string
boolean
2.0 is a...
integer
real
string
boolean
2 is a...
integer
real
string
boolean
True is a...
integer
real
string
boolean
"True" is a...
integer
real
string
boolean
False is a...
integer
real
string
boolean
"Hello" is a...
integer
real
string
boolean
Which of the following is not a type of test data?
Check
Normal
Invalid
Boundary
Boundary tests check the minimum and maximum values of an input.
True
False
What is iterative testing?
Testing completed after an error is found
Rom tests on a computer program
Tests completed as the program is being coded
Tests which are planned
There are four types of test data that can be used. Which of the following describes 'Normal data'
Values that are likely to be input
Values at limit of what program should accept
Values that program should NOT accept
Values at the max and min
There are four types of test data that can be used. Which of the following describes 'Erroneous data'
Values that are likely to be input
Values at limit of what program should accept
Values that program should NOT accept
Values higher or lower than what should be accepted
Terminal testing is.....
when you test code from a networked terminal
when a terminal error causes the code to crash
when to carry out final testing when the code is complete
when you code is so bad to need to delete it and start again
What type of error would result from you attempting to find the area of a circle, but you end up using the wrong equation.
Logic Error
Semantics Error
Syntax Error
Which of the following is a syntax error?
Attempting to divide by 0
Forgetting a colon at the end of a statement where one is required.
Forgetting to divide by 100 when printing a percentage amount.
Examples of this type of error would be missing a comma or a quotation mark, or misspelling a word.
Logic Error
Semantics Error
Syntax Error
Why is code indented?
To group together a function
The code does not use a { syntax and indentation is used instead
To make the code easier to read
All of the other answers
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
This python command lets you check some code for errors.
del
try
class
do
7. What will be output for the folllowing code?
try:
print(x)
except:
print("An exception occurred")
x
An exception occurred
Error
None of the above
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
Case statements can be used in some languages instead 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
