wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MEGA OCR Computer Science Component 2 Quiz

Total questions: 130

Worksheet time: 1hrs 22mins

Name
Class
Date
1.
Which of the following is not a sorting algorithm?
a)
Bubble
b)
Insertion
c)
Binary
d)
Merge
2.
Which sorting algorithm is described by moving through a list repeatedly, swapping elements that are in the wrong order?
a)
Merge
b)
Bubble
c)
Insertion
d)
None of the above
3.
Which sorting algorithm is described by: split a list into individual lists, then combine these, two lists at a time.
a)
Merge
b)
Bubble
c)
Insertion
d)
None of the above
4.
Which sorting algorithm is described by taking each item in turn, compare it to the items in the sorted list and place it in the ordered position in the sorted list?
a)
Merge
b)
Bubble
c)
Insertion
d)
None of the above
5.
The following two lists are to be merged, which element first goes into the new merged list?
List 1
2  4  8  9
List 2
1  6  8  4
a)
0
b)
1
c)
2
d)
3
6.
The following list is to be sorted using a bubble sort:
12  6  8  1  3
What will the list look like after the first iteration through the list?
a)
6  8  1  3  12
b)
6 12  1  8   3
c)
1  3  6  8  12
d)
6  8  1  12  3
7.
Which sorting algorithm takes an item from the list, and puts it in the correct place in a sorted list?
a)
Merge
b)
Bubble
c)
Insertion
d)
None of them do
8.
Identify the search algorithm 
a)
Random search 
b)
Binary search 
c)
Denary search 
d)
Next Item search 
9.
 Identify the description of a linear search 
a)
Put the elements in order, check each item in turn 
b)
Put the elements in order, compare to the middle value, split the list in order and repeat 
c)
Elements do not need to be in order, check each item in turn 
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat 
10.
 Identify the description of a binary search 
a)
Put the elements in order, check each item in turn 
b)
Put the elements in order, compare to the middle value, split the list in order and repeat 
c)
Elements do not need to be in order, check each item in turn 
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat 
11.
Define the term computational thinking   
a)
Using a computer 
b)
Developing an algorithm to solve a problem 
c)
Making a computer use arti cial intelligence 
d)
Google is computational thinking 
12.
Which of the following is not a component of computational thinking? 
a)
Abstraction 
b)
Typing 
c)
Decomposition 
d)
Algorithmic thinking 
13.
Define the term abstraction within computational thinking 
a)
Adding together numbers 
b)
Taking a real world problem and designing a computer program that exactly replicates every part of that problem in the computer 
c)
Performing multiple calculations on a list of variables 
d)
Representing real world problems in a computer program, using symbols and removing unnecessary elements 
14.
Define the term decomposition within computational thinking 
a)
The breaking down of a program until it no longer exists 
b)
The creation of music that can be played on a computer 
c)
The breaking down of a problem into smaller problems 
d)
The breaking down of waste to make compost 
15.
Identify which statement describes algorithmic thinking 
a)
Thinking like a computer 
b)
Writing binary numbers 
c)
Identifying the steps involved in solving a problem 
d)
Identifying what problems need to be solved 
16.
Identify the correct definition for 'algorithm'
a)
A problem
b)
A solution to a problem
c)
The steps that are taken to solve a problem
d)
The words to enter when typing
17.
Identify the purpose of the following flowchart symbol:
a)
Input/Output
b)
Output
c)
Start/Stop
d)
Decsion
18.
Identify the purpose of the following flowchart symbol:
a)
Input/Output
b)
Sub-process
c)
Process
d)
Decision
19.
Identify the purpose of the following flowchart symbol:
a)
Input/Output
b)
Sub-process
c)
Process
d)
Decision
20.
Identify the purpose of the following flowchart symbol:
a)
Process
b)
Input/Output
c)
Sub-process
d)
Decision
21.
Identify the purpose of the  following flowchart symbol:
a)
Process
b)
Input/Output
c)
Sub-process
d)
Decsion
22.
How many arrows should come out of a decision symbol in a flowchart?
a)
0
b)
1
c)
2
d)
3
23.
The following algorithm should take as input and add together two numbers, outputting the result.
Identify the correct algorithm
a)
Num1=input("Enter the first number")
Num2=input("Enter the second number")
num3=num1+num2
print(Num3)
b)
num1=input("Enter the first number")
num2=input("Enter the second number")
num3=num1+num2
print(num3)
c)
num1=input("Enter the first number")
num3=input("Enter the secon number")
num3=num1+num2
print(num3)
d)
num1=input("Enter the first number")
num2=input("Enter the second number")
num3=num1+num2
print(num2)
24.
The following algorithm should take as input a number, and output the 1 to 12 times table for that number.
Identify the correct algorithm
a)
number=input("Enter a number")
for x = 1 to 12
print(number*x)
next x
b)
number=input("Enter a number")
for x = 0 to 12
print(number * x)
next x
c)
number=input("Enter a number")
for x = 1 to 12
print(number X x)
next x
d)
number=input("Enter a number")
for x = 1 to 12
print(number*number)
next x
25.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
26.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
27.
State whether this program uses sequence, selection or iteration
a)
Sequence
b)
Selection
c)
Iteration
28.
Line 04 on this program consists of a variable or constant?
a)
Variable
b)
Constant
29.
Define the term 'variable'
a)
A location in memory to store a value that may change (as the program is running)
b)
A location in memory.  The value / contents cannot be changed (whilst the program is running)
30.
Define the term 'constant'
a)
A location in memory to store a value that may change (as the program is running)
b)
A location in memory.  The value / contents cannot be changed (whilst the program is running)
31.
State a constant in the program above
a)
PlayerKey = " "
b)
Position = 0
c)
KeyPressed
d)
Position = 100
32.
What is the name given to this common convention for variable names?  FirstName
a)
Camel case
b)
Snake case
c)
Dog case
d)
Fish case
33.
What is the name given to this common convention for variable names?  student_name
a)
Camel case
b)
Snake case
c)
Dog case
d)
Fish case
34.
What does the arithmetic operator do in this code: print(4%2)
a)
Division: Returns the result including decimal places
b)
Integer division: returns the whole number or integer from the division
c)
Modulus: this will return the remainder of the division
d)
Exponentiation: for 'powers of'
35.
What is the function of the operator  != ?
a)
Equal to: Checks if two values are equal
b)
Not equal to: Checks if two values are not equal
c)
Less than or equal to: Checks to see if one value is less than or equal to another
d)
Greater than or equal to:  Checks to see if one value is greater than or equal to another
36.
What data type would you use to store the value of pi to 2 decimal places i.e. 3.14?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
37.
What data type would you use to store someone's name?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
38.
What data type would you use to store someone's age?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
39.
What data type would you use to store yes or no?
a)
String
b)
Integer
c)
Real or Float
d)
Boolean
40.
Define what is meant by the Boolean operator OR
a)
If all of the operands are true then the condition becomes true
b)
If any of the operands are true then the condition becomes true
c)
Used to reverse the logical state of the operand
41.
Define what is meant by the Boolean operator AND
a)
If all of the operands are true then the condition becomes true
b)
If any of the operands are true then the condition becomes true
c)
Used to reverse the logical state of the operand
42.
Define what is meant by the Boolean operator NOT
a)
If all of the operands are true then the condition becomes true
b)
If any of the operands are true then the condition becomes true
c)
Used to reverse the logical state of the operand
43.
What programming concept is being shown in the image on Line 4?
a)
Concatenating
b)
Function
c)
Joiniating
d)
Merging
44.

Why is code indented?

a)

To group together a function

b)

To make it easier to identify blocks of code as part of the same logical structure

c)

To make it easier to read

d)

All answers are correct

45.

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

d)

Checking that an input meets certain criteria

e)

Confirming that someone is who they say they are

46.

Which is these IS NOT an example of validation?

a)

Checking the number entered is 2 digits

b)

Asking a user to enter the same data in twice

c)

Use of a Lookup table

d)

Use of a presence check

47.

What does a range check do?

a)

Checks data across a range of numbers

b)

Checks the data is within an acceptable range

c)

Where three types of data are used

d)

Checks that the data is in the correct format

48.

When a program runs it asks the user to enter their full name. Which of these answers is an example of Valid data?

a)

Mr Jones

b)

Sarah

c)

Sarah Jones

d)

Mrs S Jones

49.

Which of these is a NOT method of authentication?

a)

Password

b)

Password and Username

c)

Pattern Password

d)

Finger print password

50.

What is Maintainability?

a)

Checking programs work

b)

Updating code so that it is compatible with current requirements

c)

Testing a program for errors

d)

Training staff to use the program correctly

51.

Which of these is NOT a method for planning for misuse?

a)

Stripping unwanted characters

b)

Removing duplicated letters

c)

Converting lowercase to uppercase Letters

d)

Converting large numbers to smaller numbers.

e)

Calculating answers from formula

52.

Which of these is not a method for authenticating a user?

a)

Password

b)

Password and Username

c)

Finger print scanner

d)

Encryption

53.

Why are comments used in a program?

a)

They are required to make the program run

b)

Comments pad out the program and make it look more professional

c)

To keep programmers aware of any program errors and issues

d)

To help security in the code

54.

When should comments be used within a program?

a)

To help describe what the 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

55.

What is defensive programming design?

a)

Making your code / program error free

b)

Creating code that is easy to use and understand

c)

A method of ensuring that your code is not misused

d)

Code where the data is validated

56.

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

57.

A user enters in extra data attempting to access the system, such as we've seen in an SQL Injection. Which method would identify and help to prevent this issue?

a)

Data Validation

b)

Input Sanitisation

c)

Input Check

d)

Format Check

58.

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

59.

What is the difference between Data Validation and Input

Sanitsation?

a)

Nothing, they are the same

b)

Data Validation checks the data is reasonable and Sanitsation removes unexpected or unrequired data

c)

Data Validation checks the data is correct and Sanitsation removes data that contains errors

d)

Sanitisation checks the data is correct and Validation removes invalid data

e)

Calculating answers from formula

60.

When is terminal testing carried out?

a)

Before you start

b)

At the end

c)

During the project

d)

After the design section

61.

When is a run-time error identified?

a)

After the program is executed

b)

Before a program runs

c)

While the program runs

62.

Which line contains a syntax error?

a)

print (“hello”)

b)

print(“Hello”)

c)

print(“hello)

d)

print(“HELLO”)

63.

What is iterative testing?

a)

Testing completed after an error is found

b)

Random tests on a computer program

c)

Tests completed as the program is being coded

d)

Tests which are planned

64.

When a program runs it asks the user to enter their age. Which data would be most suitable to test for an incorrect piece of data being entered?

a)

44

b)

1

c)

97

d)

Forty five

65.

Consider a test plan, what comes after the Expected Result of a test?

a)

The actual result of the test

b)

The data that is to be entered

c)

The type of data type

d)

An example of the data used

66.

Testing while coding a program is called?

a)

Developmental testing

b)

Coder testing

c)

Terminal testing

d)

Iterative testing

67.

What is a null value test on data entry?

a)

Data that does not have a value such as a name or phone number

b)

Data that is not entered in order to test how the program responds

c)

Data that has a value of zero (0)

d)

Data that is incorrect

68.

What is the purpose of testing?

a)

To identify errors

b)

To identify issues that may occur when a customer uses the program

c)

To test the security of the program

d)

All answers are correct

69.
What is the output of an OR gate if the inputs are 1 and 0?
a)
0
b)
1
c)
OFF
d)
2
70.
What is the output of an AND gate if the inputs are 1 and 0?
a)
ON
b)
2
c)
1
d)
0
71.
What is the output of a NOT gate if the input is 0?
a)
1
b)
0
c)
OFF
d)
2
72.
A NOT 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 outputsQuestion 5: An OR gate has
73.
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
74.
The output of a ________ gate is only 1 when both inputs are 1.
a)
OR
b)
NOT
c)
NAND
d)
AND
75.
A NAND gate is the combination of which two gates
a)
OR and AND
b)
AND and NOT
c)
NOT and OR
d)
OR and NAND
76.
Assembly language is another name for machine code.
a)
True
b)
False
77.
Assembly language is another name for a low-level language.
a)
True
b)
False
78.
Assembly language has mnemonics.
a)
True
b)
False
79.
High level languages have mnemonics
a)
True
b)
False
80.
High level languages have keywords.
a)
True
b)
False
81.
Assemblers translate high-level language into machine code.
a)
True
b)
False
82.
Compilers translate high-level language into machine code.
a)
True
b)
False
83.
Interpreters translate high-level language into machine code.
a)
True
b)
False
84.
Interpreters translate source code all at once.
a)
True
b)
False
85.
Interpreters translate source code line by line.
a)
True
b)
False
86.
Interpreters produce executable files.
a)
True
b)
False
87.
Assemblers produce executable files.
a)
True
b)
False
88.
Compilers produce executable files.
a)
True
b)
False
89.
IDEs contain every type of translator.
a)
True
b)
False
90.
Run-time environments emulate CPUs.
a)
True
b)
False
91.
How many Bytes are used in Unicode? (1-4)
a)
8
b)
16
c)
1
d)
2
92.
The ASCII code is represented by using 16 bits. (1-4)
a)
True
b)
False
93.
Upper and lower case letters have a different ASCII code? (3-4)
a)
True
b)
False
94.
What is the maximum number of values that can be represented in 8bits? (4-6)
a)
16
b)
256
c)
65,536
d)
128
95.
What is the maximum number of values that can be represented in 7bits? (4-6)
a)
16
b)
256
c)
65,536
d)
128
96.
A character set is… (4-6)
a)
What language can be used in a computer system
b)
The fonts that a computer has installed.
c)
The possible characters that can be represented by a computer system.
97.
ASCII can represent more characters than Unicode? (4-6)
a)
True
b)
False
98.
ASCII Stands for (6-7)
a)
American Standard Code for Information Interchange
b)
American Scientific Code for Information Interchanging
c)
Absolute Standard Codes for Instruction Interchange
99.
How many bits are there in a byte? (1-4)
a)
8
b)
16
c)
1
d)
2
100.
What is the maximum number of bits needed to represent 15 in denary? (3-5)
a)
6
b)
4
101.
What is the 8 bit binary representation of 17? (5-7)
a)
00010010
b)
00010001
c)
00001101
d)
00100010
102.
What is the binary representation of 32? (5-7)
a)
00100000
b)
00100100
c)
00110000
d)
00100001
103.
Why do we use the binary number system in Computing? (4-6)
a)
Because a CPU has two transistors
b)
To represent the two different states of transistors
c)
To allow the CPU to be in one of two states
104.
What is compression? (1-4)
a)
To convert one file to another
b)
To reduce the size of data to save space
c)
To minimize the time taken for a file to be downloaded
d)
To compress something by pressing it very hard
105.
What is the hex number 6B in binary? (6-8)
a)
01101011
b)
10101110
c)
01110111
d)
11111111
106.
What does Lossy Compression do to files? (4-6)
a)
Increases the file size and keeps the same quality
b)
Eliminates no information at all
c)
Decreases the file size and keeps the same quality
d)
Eliminates unnecessary information in a file to reduce file size
107.
What is Lossless Compression? (4-6)
a)
No information is lost but file size is increased
b)
There is no loss in information at all after compression
c)
Files which have the exact same data after compression
d)
Compression that involves an algorithm
108.
What type of compression does the ZIP format use? (7-9)
a)
Lossy
b)
Lossless
109.
What type of compression would you use to compress a video? (4-6)
a)
Lossy
b)
Losslee
110.
What type of compression would you use to compress a text file (4-6)
a)
Lossy
b)
Lossless
111.
Which of the following are not in a compressed format? (7-9)
a)
JPEG
b)
MPEG
c)
Bitmap
d)
MP3
112.
When Lossy compression is used data is lost (1-4)
a)
True
b)
False
113.
What unit is sample rate measured in? (1-4)
a)
Bits per second (bps)
b)
Hertz (Hz)
c)
Megabits per second (Mbps)
114.
What is meant by bit depth? (3-6)
a)
The number of samples taken per second
b)
The amplitude of each sample
c)
The number of bits used per second of audio
d)
The number of bits used to store each sound sample
115.
Which of the following is true if you decrease the bit rate? (3-6)
a)
File size increases
b)
Sound quality increases
c)
Sound quality decreases
d)
Number of sound samples taken per second increases
116.
What is measured when the wave is sampled? (3-6)
a)
Amplitude
b)
Hertz
c)
Bit rate
d)
Frequency
117.
The purpose of a Digital to Analogue converter is to… (6-8)
a)
convert binary data into analogue form so we can hear it via a speaker
b)
convert sound waves into binary so it can be understood by a computer
118.
What piece of hardware would you use to input sound into acomputer? (1-3)
a)
Speaker
b)
Analogue to digital converter
c)
Microphone
d)
Digital to analogue converter
119.
If you increase the bit depth of an audio file then you increase thequality? (1-4)
a)
True
b)
False
120.
The amplitude of a sound wave is… (6-9)
a)
how high the wave is from the crest or trough
b)
the frequency at which it is sampled
c)
the speed at which it travels through air
121.
What do we call the smallest unit of data that can be represented inan image? (1-4)
a)
Pixel
b)
Dot
c)
Colour
d)
Bit
122.
What is meant by Colour Depth? (4-6)
a)
Number of pixels in the image
b)
The number of colours available for each pixel
c)
How pixelated the image is
123.
If you increase the colour depth then the file size will decrease? (4-6)
a)
True
b)
False
124.
How many colours can be represented with a 4 bit colour depth? (7-9)
a)
2
b)
4
c)
16
d)
256
125.
What is the term used to define what must be known about a bitmap, for it to be represented accurately? (4-6)
a)
Microdata
b)
Metadata
c)
Megadata
126.
In modern technology what unit of measurement would be used for screen size? (4-6)
a)
Pixels per inch (PPI)
b)
Dots per inch (DPI)
c)
Pixels per metre (PPM)
127.
What is the name of the type of graphic that uses shapes of solid colour? (6-8)
a)
Raster
b)
GIF
c)
JPEG
d)
Vector
128.
Which of the following is not stored as Metadata about an image? (6-9)
a)
Height
b)
Colour Depth
c)
Resolution
d)
Number of people in the image
129.
What three colours are used to produce a broad array of colours in acomputer system? (1-4)
a)
Green, Red, Orange
b)
Red, Green, Blue
c)
Yellow, Green, Red
130.
What is the Denary representation of this 8 bit number?11010101 (5-7)
a)
199
b)
206
c)
228
d)
213