wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Science Paper 2 AMH

Total questions: 120

Worksheet time: 1hrs 2mins

Name
Class
Date
1.

Which of these are logic gates?

a)

AND

b)

OR

c)

NOT

d)

IF

e)

ELSE

2.

What is the output of an AND gate if its inputs are 1 and 1?

a)

1

b)

0

3.

What is the output of an AND gate if its inputs are 1 and 0?

a)

1

b)

0

4.

What is the output of an OR gate if its inputs are 0 and 1?

a)

1

b)

0

5.

What is the output of an OR gate if its inputs are 0 and 0?

a)

1

b)

0

6.

Which logic gate does this symbol represent?

a)

AND

b)

OR

c)

NOT

d)

IF

e)

ELSE

7.

Which logic gate does this symbol represent?

a)

AND

b)

OR

c)

NOT

d)

IF

e)

ELSE

8.

What is the function of a NOT gate?

a)

Inverts its input

b)

Outputs 1 if both inputs are 1

c)

Prevents errors

d)

Outputs 0 if both inputs are 0

9.

What is the output Y of this logic cricuit if A = 1, B = 1, and C = 1

a)

0

b)

1

10.

What is the output Z of this logic cricuit if A = 1 and B = 1

a)

0

b)

1

11.

True or False:

NOT gates can only have one input

a)

True

b)

False

12.

What type of logic gate is this table showing?

a)

AND

b)

OR

c)

NOT

13.

What type of logic gate is this table showing?

a)

AND

b)

OR

c)

NOT

14.

Which logic gate is this?

a)

AND

b)

OR

c)

NOT

15.

Which logic gate is this?

a)

AND

b)

OR

c)

NOT

16.

Which logic gate is this?

a)

AND

b)

NOT

c)

OR

17.

What will this gate's output be?

a)

0

b)

1

18.

What will this gate's output be?

a)

0

b)

1

19.

What will this gate's output be?

a)

0

b)

1

20.

What will this gate's output be?

a)

0

b)

1

21.

How many different combinations of 1 and 0 are possible with 2 bits?

a)

2

b)

4

c)

6

d)

8

22.

What is the Logic Expression for this circuit?

a)

Z = NOT (A AND B)

b)

Z = NOT (A OR B)

c)

Z = (NOT A) AND B

d)

Z = (NOT A) OR B

23.

True or False:

NOT gates output the opposite of the input

a)

True

b)

False

24.
What is the output of an OR gate if the inputs are 1 and 0?
a)
0
b)
1
c)
OFF
d)
2
25.
What is the output of an AND gate if the inputs are 1 and 0?
a)
ON
b)
2
c)
1
d)
0
26.
What is the output of a NOT gate if the inputs is 0?
a)
1
b)
0
c)
OFF
d)
2
27.
An OR gate has
a)
Two inputs and one output
b)
One input and one output
c)
One input and two outputs
d)
Two inputs and two outputs
28.
What gate is this table for?
a)
AND
b)
OR
c)
NOT
d)
NOR
29.
A truth table lists every possible combination of input and the resulting output
a)
True
b)
False
30.
There are three fundamental operations in Boolean Algebra: ___
a)
Addition, Subtraction and Multiplication
b)
NOT, AND, and OR
c)
IF, AND, and BUT
d)
IF, ELSE and ELSE IF
31.

Which of the following is NOT a variable?

a)

Number

b)

Count

c)

userGuess

d)

input

32.

On line 5, + is a:

a)

Comparison operatior

b)

Boolean Operator

c)

Assignment Operator

d)

Arithmetic operator

33.

On which line will the user be asked to input a number?

a)

1

b)

3

c)

2

d)

4

34.

On which line is the variable count first initialised?

a)

1

b)

5

c)

2

d)

7

35.

On which line is iteration used?

a)

5

b)

7

c)

6

d)

3

36.

On line 6, == is a:

a)

Arithmentic operator

b)

Assignment Operator

c)

Comparison Operator

d)

Boolean Operator

37.

On which line is the variable count incremented by 1?

a)

1

b)

7

c)

5

d)

2

38.

On line 2, = is a

a)

Comparison Operator

b)

Boolean Operator

c)

Arithmentic Operator

d)

Assignment Operator

39.

On which line is selection used?

a)

6

b)

3

c)

10

d)

4

40.

On which line is a concatenation used?

a)

1

b)

7

c)

4

d)

11

41.

On which line does a sequence start?

a)

1

b)

10

c)

4

d)

9

42.

What is the data type of count?

a)

float

b)

string

c)

integer

d)

Boolean

43.

what type of variable is UserGuess

a)

Float

b)

Integer

c)

String

d)

Boolean

44.

What is the data type of i?

a)

Float

b)

Integer

c)

String

d)

Boolean

45.

Which of the following is not done by abstraction?

a)

Identifies essential details

b)

Disregards non-essential information

c)

Breaks the problem down into smaller tasks

46.

Which of the following is not done by decomposition?

a)

Allows multiple people to work on the problem together

b)

Disregards non-essential information

c)

Breaks the problem down into smaller tasks

47.

When drawing a dog, which of the following characteristics is non-essential?

a)

Dogs have 4 paws

b)

Dogs have fur

c)

Dogs have brown fur

48.

When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?

a)

Number of doors

b)

Number of walls

c)

Number of wall paintings

49.

One advantage of abstraction is that it means no mistakes can be made

a)

True

b)

False

50.

You could use abstraction to replace specific objects with simple shapes

a)

True

b)

False

51.

This is a good example of decomposition

Sit down

Do homework

a)

True

b)

False

52.

Decomposition allows each task to become _______

a)

More manageable

b)

Easier

c)

Quicker

53.

Decomposition allows the entire task to be completed as _____

a)

A Team

b)

A Whole

c)

Quickly as possible

54.

Abstraction and Decomposition are separate concepts, you would usually choose to do either one or the other

a)

True

b)

False

55.

It is always necessary to decompose a task

a)

True

b)

False

56.

Abstraction and Decomposition are examples of...

a)

Computational Thinking

b)

Algorithmic Thinking

c)

Computer Science

d)

Logical Reasoning

57.

What is pattern recognition?

a)

Breaking down a complex problem into smaller problems

b)

Looking for similarities among and within problems

c)

Building models from patterns

58.

Why do we need to look for patterns in problems?

a)

Patterns make it easier for us to solve complex problems

b)

We don't need to look for patterns

c)

Patterns make it more difficult complex problems

59.

If you don't look for patterns in a problem, your solution might be _____

a)

Wrong

b)

Inefficient

c)

Too slow

60.

Identifying the steps involved in solving a problem

a)

Abstraction

b)

Decomposition

c)

Pattern Recognition

d)

Algorithmic Thinking

61.
Which of the following is an example of thinking computationally?
a)
Planning out your route when going to meet a friend
b)
When going to meet a friend, wandering around until you find them
c)
When going to meet a friend, asking a parent to plan your route for you
62.

Looking for similarities and trends within a problem

a)

Abstraction

b)

Decomposition

c)

Pattern recognition

d)

Algorithmic Thinking

63.

What is a flowchart?

a)

A visual representation of an algorithm.

b)

A diagram that shows abstraction.

c)

A series of shapes.

64.

A school database has lots of information on students, the data manager needs to use abstraction. What data should she leave out?

a)

Age

b)

Guardian's phone numbers

c)

Classes

d)

Eye colour

65.

A boolean is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

66.

An integer is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

67.

A real is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

68.

A string is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

69.

Pick the correct line which creates a variable called 'name' which is a string.

a)

name is string

b)

string = name

c)

name = string

d)

string is name

70.

The best data type for an age is...

a)

integer

b)

real

c)

string

d)

boolean

71.

The best data type for a name is...

a)

integer

b)

real

c)

string

d)

boolean

72.

The best data type for an average is...

a)

integer

b)

real

c)

string

d)

boolean

73.

The best data type for a counter is...

a)

integer

b)

real

c)

string

d)

boolean

74.

8.2 is a...

a)

integer

b)

real

c)

string

d)

boolean

75.

2.0 is a...

a)

integer

b)

real

c)

string

d)

boolean

76.

2 is a...

a)

integer

b)

real

c)

string

d)

boolean

77.

True is a...

a)

integer

b)

real

c)

string

d)

boolean

78.

"True" is a...

a)

integer

b)

real

c)

string

d)

boolean

79.

False is a...

a)

integer

b)

real

c)

string

d)

boolean

80.

"Hello" is a...

a)

integer

b)

real

c)

string

d)

boolean

81.

Which of the following is not a type of test data?

a)

Check

b)

Normal

c)

Invalid

d)

Boundary

82.

Boundary tests check the minimum and maximum values of an input.

a)

True

b)

False

83.
Which of the following should be used to carry out an invalid test on the input of a person's age?
a)
-10
b)
10
c)
110
d)
0
84.

What is iterative testing?

a)

Testing completed after an error is found

b)

Rom tests on a computer program

c)

Tests completed as the program is being coded

d)

Tests which are planned

85.

There are four types of test data that can be used. Which of the following describes 'Normal data'

a)

Values that are likely to be input

b)

Values at limit of what program should accept

c)

Values that program should NOT accept

d)

Values at the max and min

86.

There are four types of test data that can be used. Which of the following describes 'Erroneous data'

a)

Values that are likely to be input

b)

Values at limit of what program should accept

c)

Values that program should NOT accept

d)

Values higher or lower than what should be accepted

87.

Terminal testing is.....

a)

when you test code from a networked terminal

b)

when a terminal error causes the code to crash

c)

when to carry out final testing when the code is complete

d)

when you code is so bad to need to delete it and start again

88.
Q8: A program runs & asks the user to enter their age. Which is erroneous test data? (1-3)
a)
44
b)
1
c)
97
d)
Forty Five
89.
A program won't run if there is a logic error.
a)
False
b)
True
90.
Modern IDEs are able to spot syntax errors as the programmer types.
a)
True
b)
False
91.

What type of error would result from you attempting to find the area of a circle, but you end up using the wrong equation.

a)

Logic Error

b)

Semantics Error

c)

Syntax Error

92.

Which of the following is a syntax error?

a)

Attempting to divide by 0

b)

Forgetting a colon at the end of a statement where one is required.

c)

Forgetting to divide by 100 when printing a percentage amount.

93.

Examples of this type of error would be missing a comma or a quotation mark, or misspelling a word.

a)

Logic Error

b)

Semantics Error

c)

Syntax Error

94.
When should comments be used within a program?
a)
To help describe what code and structures are expected to do
b)
To remind the developer of when lunch is
c)
To include what tests must be carried out on the code
d)
Every line, so that you know exactly what is happening
95.
 A user attempts to enter in an incorrect password, what method would identify this issue?
a)
Data Validation
b)
Authentication
c)
Program Comments
d)
Indentation
96.
A program has a section of code that could cause errors, which method could be used to identify this issue? 
a)
Maintainability
b)
Authentication
c)
Program Comments
d)
Indentation
97.

Why is code indented?

a)

To group together a function

b)

The code does not use a { syntax and indentation is used instead

c)

To make the code easier to read

d)

All of the other answers

98.

What is data validation?

a)

Checking that the data entered is wrong

b)

Checking that the data entered is correct

c)

Checking that the data entered is sensible or reasonable

99.

This python command lets you check some code for errors.

a)

del

b)

try

c)

class

d)

do

100.

7. What will be output for the folllowing code?

try:

print(x)

except:

print("An exception occurred")

a)

x

b)

An exception occurred

c)

Error

d)

None of the above

101.

What is an algorithm?

a)

A flowchart

b)

Step by step instructions used to solve a problem

c)

A decision

d)

A flowchart or pseudocode

102.

What are the three algorithm constructs?

a)

Sequence, Selection, Iteration

b)

Input, Process, Output

c)

Input/output, decision, terminator

d)

Loop, input/output, process

103.

What is the difference between a flowchart and pseudocode?

a)

A flowchart is diagrammatic whilst pseudocode is written in a programming language

b)

A flowchart is textual but pseudocode is diagrammatic

c)

A flowchart is a diagrammatic description of an algorithm whilst pseudocode is a textual description of an algorithm

d)

A flowchart and pseudocode are the same thing

104.

In a flowchart an input or output instruction is represented by:

a)

A rectangle

b)

A rhombus

c)

A parallelogram

d)

A circle

105.

In a flowchart a calculation (process) is represented by:

a)

A rectangle

b)

A rhombus

c)

A parallelogram

d)

A circle

106.

In a flowchart a decision (selection) is represented by:

a)

A rectangle

b)

A rhombus

c)

A parallelogram

d)

A circle

107.

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?

a)

Decision (Selection)

b)

Loop (Iteration)

c)

Order (Sequence)

d)

All of the above

108.

An Algorithm asks the user to enter their scores for 5 different tests.

This is an example of which of the algorithm constructs?

a)

Decision (Selection)

b)

Loop (Iteration)

c)

Order (Sequence)

d)

All of the above

109.

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?

a)

Decision (Selection)

b)

Loop (Iteration)

c)

Order (Sequence)

d)

All of the above

110.

What is a "Variable" ?

a)

A value that can be changed and manipulated as an algorithm is running

b)

A value that cannot be changed and manipulated as an algorithm is running

111.

Variables are assigned an identifier. The identifier should be:

a)

not too long

b)

have a sensible name

c)

not start with a number

d)

not start with a capital letter

e)

all of the above

112.

firstName is and example of what commonly used way to name a variable

a)

camelcase

b)

snakecase

c)

linecase

d)

hillcase

113.

first_name is and example of what commonly used way to name a variable

a)

camelcase

b)

snakecase

c)

linecase

d)

hillcase

114.

What type of operators are + - * / DIV MOD ^

a)

Arithmetic

b)

Relational

c)

Booleon

115.

What type of operators are == != < > <= >=

a)

Arithmetic

b)

Relational

c)

Booleon

116.

What type of operators are AND OR NOT

a)

Arithmetic

b)

Relational

c)

Booleon

117.

Booleon operators are also know as:

a)

Logical operators

b)

Combination operators

c)

Algorithmic operators

d)

Flow operators

118.

This an example of:

a)

a nested if

b)

a combined if

c)

a multiple if

d)

a sequence if

119.

Case statements can be used in some languages instead of:

a)

a nested if

b)

a combined if

c)

a multiple if

d)

a sequence if

120.

Here is an algorithm used to calculate whether a worker should get a bonus.

How much bonus would they get if their WagesEarned = 200

a)

50

b)

250

c)

200

d)

150