Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Science P2 Prep

Total questions: 61

Worksheet time: 31mins

Name
Class
Date
1.

Which logic gate is shown here?

a)

OR

b)

NOT

c)

AND

d)

NAND

2.

The Boolean expression for this circuit is:

output = A​ (a)   B ​ (b)   C

Choose from the below words
OR
AND
NOT
3.

Choose the correct circuit for the following expression: P = (A V B) ∧\wedge ¬C

a)

b)

c)

4.

Which of the following code is used to cast a string to an integer?

a)

bool("False")

b)

str("False")

c)

integer("123")

d)

int("123")

5.

Identify the code which outputs 10 numbers correctly

a)

for i in range(0,11)

b)

for i in range(0,10)

c)

for i in range(1,9)

d)

for i in range(1,10)

6.

Which of the following is the correct code to create an array to store some integers?

a)

age = (2, 3, 1)

b)

age = ["2", "3", "1"]

c)

age = ["2" "3" "1"]

d)

age = [2, 3, 1]

7.

What is the correct value after this calculation? 5 mod 2

a)

1

b)

2

c)

2.5

d)

3

8.

What is the correct value after this calculation? 5 div 2

a)

1

b)

2

c)

2.5

d)

3

9.

What is the purpose of the following code?

Hide Answers

a)

Opens a file for you to write into it

b)

Opens a file for you to read the first line

c)

Opens a file called name to store in an array

d)

Opens a file called name to store in an array

10.

In the following code how many parameters are used?

a)

1

b)

2

c)

3

d)

4

11.

In the following code how many local variables are there?

a)

1

b)

2

c)

3

d)

4

12.

What is the most suitable data type to store someone's name?

a)

String

b)

Character

c)

Integer

d)

Boolean

13.

What is the most suitable data type to store the cost of an item?

a)

String

b)

Real/Float

c)

Integer

d)

Boolean

14.

What is the following value that will be extracted using the code?

a)

Mr

b)

Liu

c)

Com

d)

Sci

15.

Which of the following best describes a constant?

a)

A memory store that store data that can be changed during the program

b)

A memory store that store data that cannot be changed during the program

c)

A memory store to store the value of an integer

d)

A memory store to store the value of a string

16.

What type of error is in the following code?

a)

Syntax

b)

Logical

c)

Data Type error

d)

Sequence program

17.

What type of error is in the following code?

a)

Syntax

b)

Logical

c)

Data Type Error

d)

Sequence problem

18.

What name will be printed?

a)

Messi

b)

Salah

c)

Mbappe

d)

Ronaldo

19.

What type of subprogram is the following?

a)

Function

b)

Array

c)

Iteration

d)

Procedure

20.

What is the correct value that will be extracted from the following code?

a)

Salah

b)

Liverpool

c)

Ronaldo

d)

Man Utd

21.

What type of data structure is the following?

a)

Constant

b)

Variable

c)

1D Array

d)

2D Array

22.

The IF STATEMENT belongs to which programming construct?

a)

Selection

b)

Sequencing

c)

Iteration

d)

Data Structure

23.

The WHILE STATEMENT belongs to which programming construct?

a)

Selection

b)

Squencing

c)

Iteration

d)

Data Structure

24.

Which of the following can be used to help with maintainability?

a)

Use of sub programs

b)

Input validation

c)

Authentication

d)

Iterative Testing

25.

Which of the following can be used to help with maintainability?

a)

Naming conventions for variables

b)

Input validation

c)

Authentication

d)

Iterative Testing

26.

Which of the following can be used to help with maintainability?

a)

Commenting

b)

Input validation

c)

Authentication

d)

Iterative Testing

27.

Which of the following can be used to help with maintainability

a)

Indentation

b)

Input validation

c)

Authentication

d)

Iterative Testing

28.

What best describes the following? Testing while developing your program.

a)

Iterative Testing

b)

Use of sub programs

c)

Authentication

d)

Anticipating Misuse

29.

What best describes the following? Testing at the end of development.

a)

Final Testing

b)

Use of sub programs

c)

Authentication

d)

Anticipating Misuse

30.

Which of the following data would be classed as normal test data?

a)

17

b)

abc

c)

-1

d)

15

31.

Which of the following data would be classed as boundary test data?

a)

17

b)

abc

c)

-1

d)

15

32.

Which of the following data would be classed as invalid/erroneous test data?

a)

17

b)

abc

c)

-1

d)

15

33.

Which is the meaning of input validation?

a)

Checking whether the user can log in or not

b)

Checking if an input value fits in with the rules

c)

Checking if the input is maintainable

d)

Checking if the input is correct for test data

34.

Which of the SQL statements will correctly output one row of information?

a)

SELECT * FROM teachers WHERE year group > 7

b)

SELECT * FROM teachers WHERE subject = "Art" and subject = "Business"

c)

SELECT * FROM teachers WHERE subject = "Art"

d)

SELECT * FROM teachers WHERE name = "Mr Liu" or name = "Mr Prior"

35.

Which of the SQL statements will correctly output year groups between 12 and 13?

a)

SELECT * FROM teachers WHERE year group > 11 and year group < 14

b)

SELECT * FROM teachers WHERE year group > 7

c)

SELECT * FROM teachers WHERE year group > 12 and year group < 13

d)

SELECT * FROM teachers WHERE year group > "11" and year group < "14"

36.

Compilers will....

a)

Convert source code in one go

b)

Convert source code line by line

c)

Convert source code so that it is maintainable

d)

Check for authentication

37.

Which of the following is classed as low level language?

a)

Machine Code

b)

Python

c)

C++

d)

Javascript

38.

Interpreter will....

a)

Convert source code in one go

b)

Convert source code line by line

c)

Convert source code so that it is maintainable

d)

Check for authentication

39.

IDE stands for?

a)

Information Development Environment

b)

Integrated Development Environment

c)

Integrated Design Environment

d)

Information Design Environment

40.

Editors are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

41.

Translators are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

42.

Error diagnostics are provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

43.

Run time environment is provided within an IDE what are they used for?

a)

To input source code

b)

To check for errors

c)

To compile your program

d)

To provide tools such as variable tracing and breakpoints

44.

One instruction of high-level code represents many instructions of machine code

a)

High-level languages

b)

Low-level languages

45.

Usually written for one type of machine or processor and won't work on any others.

a)

High-Level Languages

b)

Low-Level Languages

46.

Code is very difficult to read, understand and modify.

a)

High-Level Languages

b)

Low-Level Languages

47.

Commands in machine code can be executed directly without the need for a translator.

a)

High-Level Languages

b)

Low-Level Languages

48.

(a)   is a check made by a computer to ensure that the data entered is sensible or reasonable.

49.

What type of validation would be used on a field to enter a mobile phone number to ensure it contains 11 digits

a)

Spell check

b)

Lookup table

c)

Presence check

d)

Length check

50.

What type of validation would be used on a field to check that data has been entered?

a)

Spell check

b)

Lookup table

c)

Presence check

d)

Length check

51.

What type of validation is used to check that a value falls within the specified range

a)

Spell check

b)

Range check

c)

Presence check

d)

Length check

52.

What type of validation should be used to ensure a National Insurance number is in the form LL 99 99 99 L where L is any letter and 9 is any number?

a)

Format check

b)

Range check

c)

Presence check

d)

Length check

53.

What does 'Defensive Design' mean?

a)

A method of planning a program using shapes.

b)

A method of planning a program using plain English.

c)

A method of designing a program so that it functions properly and doesn't crash.

d)

A method of checking that an input matches the criteria.

54.

What does 'Input Validation' mean?

a)

A method of removing unwanted characters from an input.

b)

A method of planning a program using plain English.

c)

A method of designing a program so that it functions properly and doesn't crash.

d)

A method of checking that an input matches the criteria.

55.
Which of the following could be considered abstraction
a)
Focusing on irrelevant information
b)
Removing important aspects
c)
Removing unneccessary details
d)
Looking for patterns in programs
56.
Abstraction is the process of removing necessary details from a problem
a)
True
b)
False
57.
Abstraction leaves the following details in a problem
a)
Necessary Details
b)
Unnecessary Details
58.
What is decomposition
a)
Removing unnecessary details to simplify a problem
b)
Planning clear steps to solving a problem
c)
Breaking a problem down into more manageable chunks
d)
Looking for similarities in problems
59.
Dealing with different stages of a problem at once make it more difficult to solve
a)
True
b)
False
60.
Decomposition allows use to develop parts of a program at different times
a)
True
b)
False
61.
Decomposition removes unnecessary details from a problem
a)
True
b)
False