wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Ocr GCSE Computer Science

Total questions: 91

Worksheet time: 47mins

Name
Class
Date
1.

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

2.

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

3.

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

4.

What type of validation is when the last one or two digits in a code are used to check the other digits are correct?

a)

Spell check

b)

Check digit

c)

Presence check

d)

Length check

5.

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

6.

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

7.

Another method for validating data and stopping attacks is to clean up the data that is inputted so that it is ready for the application to use.

(a)   trims or strips strings, removing unwanted characters from strings

8.

Which one of the following inputs for an email address would not require data santisation?

a)

dave.smith@company.c

b)

d.s@company.com

c)

dave@smith@company.com

d)

dave smith@company.com

9.

(a)   will consider and anticipate misuse.

Misuse may be in the form of a brute force attack on the program

10.

(a)   is a coding method to check that a user is who they say they are and allowed to access the program.

11.

New software often requires a key code which is generated by an app on the user's phone and then entered.

Online banking requires a user to enter credentials into a webpage and then a number is generated which is entered into a key device.

This returns a number code which is entered into the webpage as well.

Without the second part of the code the user is not authenticated.


What process is this describing?

(a)  

12.

Tick two methods to provide information for future users or programmers that may be required to maintain the code.

a)

Complex code

b)

Indentation

c)

Comments

d)

Concise variable name

13.

Who is this?

a)

Ada Lovelace

b)

Grace Hopper

c)

Margaret Hamilton

d)

Dorothy Vaughan

14.

What term did she famously coin for finding a fault in a program?

a)

error

b)

syntax flaw

c)

moth

d)

bug

15.

What type of errors may cause program errors or the computer to crash even if there appears to be nothing wrong with the program code?

a)

Syntax errors

b)

Runtime errors

c)

Logic errors

d)

Memory errors

16.

What type of errors are mistakes in the way that the code is written?

a)

Syntax errors

b)

Runtime errors

c)

Logic errors

d)

Memory errors

17.

What type of error is a bug in a program that causes it to operate incorrectly, but not to terminate or crash?

a)

Syntax errors

b)

Runtime errors

c)

Logic errors

d)

Memory errors

18.

Identify the type of error in the pseudocode

a)

Syntax error

b)

Runtime error

c)

Logic error

d)

Memory error

19.

Identify the type of error in the pseudocode

a)

Syntax error

b)

Runtime error

c)

Logic error

d)

Memory error

20.

Identify the type of error in the pseudocode

a)

Syntax error

b)

Runtime error

c)

Logic error

d)

Memory error

21.

What are the two types of testing discussed at GCSE?

a)

Alpha testing

b)

Beta testing

c)

Iterative testing

d)

Final / terminal testing

22.

When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be valid data?

a)

10kg

b)

22kg

c)

23kg

d)

24kg

e)

100kg

23.

When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be invalid data?

a)

10kg

b)

22kg

c)

23kg

d)

24kg

e)

100kg

24.

When testing a program that checks the weight of cabin baggage is less than or equal to 23kg, which of the following would be boundary data?

a)

10kg

b)

22kg

c)

23kg

d)

24kg

e)

100kg

25.

Which of the following would you expect to find in a Test Plan?

a)

The test number

b)

The data entered

c)

The type of test data

d)

The expected outcome

e)

The result of the test

26.

A variable is...

a)

A memory location used to store a value that can change.

b)

A memory location used to store a value that cannot change

27.

A constant is...

a)

A memory location used to store a value that can change.

b)

A memory location used to store a value that cannot change

28.

'Sequence' means...

a)

When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE

b)

When lines of code loop e.g. WHILE, FOR

c)

When lines of code runs one line after the other

29.

'Selection' means...

a)

When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE

b)

When lines of code loop e.g. WHILE, FOR

c)

When lines of code runs one line after the other

30.

'Iteration' means...

a)

When lines of code only run if a condition is met. e.g. IF, ELIF, ELSE

b)

When lines of code loop e.g. WHILE, FOR

c)

When lines of code runs one line after the other

31.

A STRING is...

a)

A TRUE/FALSE or YES/NO value

b)

A word, or number not used in Maths.

c)

A whole number

d)

A number with a decimal point

32.

An INTERGER is...

a)

A TRUE/FALSE or YES/NO value

b)

A word, or number not used in Maths.

c)

A whole number

d)

A number with a decimal point

33.

A FLOAT is...

a)

A TRUE/FALSE or YES/NO value

b)

A word, or number not used in Maths.

c)

A whole number

d)

A number with a decimal point

34.

A BOOLEAN value is...

a)

A TRUE/FALSE or YES/NO value

b)

A word, or number not used in Maths.

c)

A whole number

d)

A number with a decimal point

35.

The data value '4.5' would be a...

a)

STRING

b)

INTERGER

c)

FLOAT

d)

BOOLEAN

36.

The data value 'Steve' would be a...

a)

STRING

b)

INTERGER

c)

FLOAT

d)

BOOLEAN

37.

The data value '250' would be a...

a)

STRING

b)

INTERGER

c)

FLOAT

d)

BOOLEAN

38.

The data value 'TRUE' would be a...

a)

STRING

b)

INTERGER

c)

FLOAT

d)

BOOLEAN

39.

The data value 'Phone Number: 07284 281837' would be a...

a)

STRING

b)

INTERGER

c)

FLOAT

d)

BOOLEAN

40.

'Casting' means...

a)

Converting data types e.g. int(), str()

b)

Removing unwanted data

c)

Creating a new variable

d)

Creating a new constant

41.

file = open("textfile.txt", "r") means...

a)

Open a file called 'textfile' and add to it.

b)

Open a file called 'textfile', empty it and then write to it

c)

Open a file called 'textfile' and read it.

42.

file = open("textfile.txt", "a") means...

a)

Open a file called 'textfile' and add to it.

b)

Open a file called 'textfile', empty it and then write to it

c)

Open a file called 'textfile' and read it.

43.

file = open("textfile.txt", "w") means...

a)

Open a file called 'textfile' and add to it.

b)

Open a file called 'textfile', empty it and then write to it

c)

Open a file called 'textfile' and read it.

44.

SQL statements always use...

a)

WHERE

FROM

SELECT

b)

SELECT

FROM

WHERE

c)

FROM

SELECT

WHERE

d)

SELECT

WHERE

FROM

45.

To create a sub program, we use:

a)

while function == 1:

b)

def function():

c)

function = input()

46.

We create a random number (between 1-6) with...

a)

random = [1,2,3,4,5,6]

b)

random1-6:

c)

random.num(6)

d)

random.randint(1,6)

47.

The examples of maintainability below are... (select 3):

a)

Comments in code

b)

Indentation

c)

Appropriate variable names

d)

Abstraction

48.

Changing an input so it works in a program (e.g. turning lowercase into uppercase)

a)

Input Sanitation

b)

Input Validation

c)

Input Creation

d)

Input Testing

49.

Testing an input and ensuring it is in the correct format or range

a)

Input Sanitation

b)

Input Validation

c)

Input Creation

d)

Input Testing

50.

Authentication means...

a)

Checking a user is who they say they are (e.g. username/password)

b)

Helping a piece of code become more readable

c)

Testing a program while it is being created,

51.

A syntax error means...

a)

An error that still allows the code to run, however not as expected.

b)

An error that prevents the code from running as it does not follow the code language rules.

52.

A logic error means...

a)

An error that still allows the code to run, however not as expected.

b)

An error that prevents the code from running as it does not follow the code language rules.

53.

prnit("Welcome to the Game")

is an example of a...

a)

Logic Error

b)

Syntax Error

54.

score = 1

print("score")

is an example of a...

a)

Logic Error

b)

Syntax Error

55.

The purpose of testing in programming is... (select 2):

a)

To check that the program hits the user requirements

b)

To save variables in the correct places in RAM

c)

To add comments into the code

d)

To check the code runs as expected.

56.

Final/terminal testing takes place...

a)

Many times throughout a programming project

b)

At the end of a programming project

57.

Iterative testing takes place...

a)

Many times throughout a programming project

b)

At the end of a programming project

58.

Normal test data is used to...

a)

Test a value that is just inside/outside of what should/shouldn't be accepted.

b)

Test a value that is expected in a program and should work.

c)

Test a value that should be rejected by the program.

59.

Boundary test data is used to...

a)

Test a value that is just inside/outside of what should/shouldn't be accepted.

b)

Test a value that is expected in a program and should work.

c)

Test a value that should be rejected by the program.

60.

Erroneous test data is used to...

a)

Test a value that is just inside/outside of what should/shouldn't be accepted.

b)

Test a value that is expected in a program and should work.

c)

Test a value that should be rejected by the program.

61.

What logic gate is this?

a)

AND

b)

NOT

c)

OR

62.

What logic gate is this?

a)

AND

b)

NOT

c)

OR

63.

What logic gate is this?

a)

AND

b)

NOT

c)

OR

64.

If 1 is the input, the output will be...

a)

0

b)

1

65.

If input A is 1, and input B is 1, the output will be...

a)

0

b)

1

66.

If input A is 1 and input B is 0, the output will be...

a)

0

b)

1

67.

DIV means...

a)

Dividing without including the remainder

b)

Dividing, but only writing the remainder

c)

Multiplying the number by itself

68.

MOD means...

a)

Dividing without including the remainder

b)

Dividing, but only writing the remainder

c)

Multiplying the number by itself

69.

^ means...

a)

Dividing without including the remainder

b)

Dividing, but only writing the remainder

c)

Multiplying the number by itself

70.

13 DIV 4 =

(a)  

71.

29 DIV 5 =

(a)  

72.

63 DIV 10 =

(a)  

73.

34 MOD 5 =

(a)  

74.

12 MOD 6 =

(a)  

75.

100 MOD 9 =

(a)  

76.

4^2 =

(a)  

77.

2^3 =

(a)  

78.

3^3 =

(a)  

79.

High-level language means...

a)

A programming language that uses short and basic single words

b)

A programming language that uses English-like words

c)

1s and 0s - used by the CPU

80.

Low-level language means...

a)

A programming language that uses short and basic single words

b)

A programming language that uses English-like words

c)

1s and 0s - used by the CPU

81.

Machine code means...

a)

A programming language that uses short and basic single words

b)

A programming language that uses English-like words

c)

1s and 0s - used by the CPU

82.

" score = input("Enter a number") "

is an example of...

a)

High-level language

b)

Low-level language

c)

Machine code

83.

INP 10

STA 12

OUT 28

is an example of...

a)

High-level language

b)

Low-level language

c)

Machine code

84.

1001 0101

0011 1111

0101 1110

is an example of...

a)

High-level language

b)

Low-level language

c)

Machine code

85.

A translator...

a)

Tests an input and changes it to fit with the program (e.g. lowercase to uppercase)

b)

Tests the code and checks for errors

c)

Tells the program where the variables are stored in RAM

d)

Converts high-level language into machine code so the CPU can run the program.

86.

A complier translator... (select 2):

a)

... is used during development of code

b)

...is used at the end when the code is finished

c)

...is quick and reports errors as is translates

d)

...takes some time and produces a list of errors at the end

87.

An interpreter translator... (select 2):

a)

... is used during development of code

b)

...is used at the end when the code is finished

c)

...is quick and reports errors as is translates

d)

...takes some time and produces a list of errors at the end

88.

2 examples of IDE tools are...

a)

Editor tools (e.g. line numbering, colour coding)

b)

Selection (when lines of code run one after another)

c)

Iteration (when lines of code loop)

d)

Translators

89.

2 examples of IDE tools are...

a)

Variable names must be suitable and appropriately named.

b)

Run-time environment (You can run the code before its finished)

c)

Debugging tools (errors are reported and advice is given to the user)

d)

Selection (lines of code only runs if a condition is met)

90.

The user can input something using the code...

a)

input("Enter a value")

b)

print("Enter a value")

c)

variable("Enter a value")

d)

while("Enter a value")

91.

We can output something using the code...

a)

input("Hello")

b)

print("Hello")

c)

variable("Hello")

d)

while("Hello")