wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Y12 OOP-FLT-STK-Q-PRG mmd

Total questions: 118

Worksheet time: 1hrs 16mins

Name
Class
Date
1.

What is the binary number 0111 1101 in hexadecimal?

a)

AC

b)

9C

c)

9D

d)

8B

2.

Which of these is a floating point number?

a)

3

b)

3.0

c)

7

d)

5.6

3.
Using 8-bit sign and magnitude, represent the denary value of -2 in binary
a)
01001010
b)
10000010
c)
00001001
d)
00010010
4.
Using two's complement, represent the denary value of 59 in binary
a)
111011
b)
001011
c)
001001
d)
011110
5.
Add the 2 following pairs of unsigned 8-bit binary integers: 10000100 + 01011101
a)
11100001
b)
11010010
c)
00001010
d)
10011011
6.

100101000011 (8 bit signed mantissa / 4 bit signed exponent) what is the decimal number?

a)

9.25

b)

-9.25

c)

-6.75

d)

6.75

7.

What is the normalised form of 0.0000111 0111

a)

1.0110000 0011

b)

1.0110000 0111

c)

0.1110000 0111

d)

0.1110000 0011

8.

Add 0.1100000 0001 and 0.1111100 0011 and normalise the result.

a)

1001.0100 0100

b)

0.1001010 0100

c)

1.0010100 0100

d)

0.1010100 0111

9.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
10.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
11.

You can change an object members via its:

a)

methods

b)

attributes

c)

modifiers

d)

parameters

12.
Constructors are called just once when ______.
a)

an object is being instantiated

b)
a class is being terminated
c)
class is being closed
d)
an object is being destroyed
13.

What is an object?

a)

Everything

b)

An instance of a class

c)

A detail of a class

d)

A class of details

14.

A method is...

a)

A way of calculating things in Java

b)

A strategy for programming

c)

A predefined set of instructions in a class

d)

A way to sore details in a class

15.

What does an object consist of?

a)

Methods

b)

Subs and Members (Attributes)

c)

Methods and Members (Attributes)

d)

Procedures

e)

Variables

16.

A Parent or Super Class is...

a)

A class about children

b)

A class which other classes can inherit functionality from

c)

A class which other classes can inherit members from

d)

A private class

17.

Multiple methods (of the same name) which can receive different types or numbers of parameters is known as:

a)

Overriding

b)

Overcasting

c)

Overloading

d)

Overworking

18.

We extend a class using:

a)

Spaces

b)

Inheritance

c)

Overloading

d)

Branching

19.

 ...is where an object instantiated of a parent class can also be an instance of a derived class.

a)

Polytechnic

b)

Polycoding

c)

Polymoreism

d)

Polymorphism

20.

Which of the following statements is describing the skill of, 'thinking abstractly'?

a)

Breaking a problem down

b)

Identifying the preconditions of a system, the inputs, outputs and reusable components

c)

Removing unnecessary details and including only the relevant details

d)

Identifying decision points for branching or iteration

e)

Means solving problems at the same time.

21.

Which of the following statements is describing the skill of, 'thinking ahead'?

a)

Breaking a problem down

b)

Identifying the preconditions of a system, the inputs, outputs and reusable components

c)

Removing unnecessary details and including only the relevant details

d)

Identifying decision points for branching or iteration

e)

Means solving problems at the same time.

22.

Which of the following statements is describing the skill of, 'thinking procedurally'?

a)

Breaking a problem down, allowing them the smaller problems to be solved.

b)

Identifying the preconditions of a system, the inputs, outputs and reusable components

c)

Removing unnecessary details and including only the relevant details

d)

Identifying decision points for branching or iteration

e)

Means solving problems at the same time.

23.

Which of the following statements is describing the skill of, 'thinking logically'?

a)

Breaking a problem down, allowing them the smaller problems to be solved.

b)

Identifying the preconditions of a system, the inputs, outputs and reusable components

c)

Removing unnecessary details and including only the relevant details

d)

Identifying decision points for branching or iteration

e)

Means solving problems at the same time.

24.

Which of the following statements is describing the skill of, 'thinking concurrently'?

a)

Breaking a problem down, allowing them the smaller problems to be solved.

b)

Identifying the preconditions of a system, the inputs, outputs and reusable components

c)

Removing unnecessary details and including only the relevant details

d)

Identifying decision points for branching or iteration

e)

Means solving problems at the same time.

25.

What is meant by the term 'abstraction'?

a)

A simplified programming language used in program design

b)

Getting to a solution through the clear definition of the steps needed

c)

Including the necessary details and leaving out the unnecessary details

d)

Breaking a problem down into smaller sub-problems

26.

When designing systems, it is important to consider what aspects are important to solve the problem and what are not. What is this known as?

a)

Abstraction

b)

Reality

c)

Programming

d)

Implementation

27.

You have been asked to design an abstract model for a satellite navigation program. Out of the following details, which you recommend removing from the finished model?

a)

Location of petrol and service stations

b)

Names of roads and motorways

c)

Wooded areas illustrated with trees

d)

Place names of towns and cities

28.

You have been asked to design an abstract model for a school canteen program. Out of the following details, which you recommend removing from the finished model?

a)

Students full names

b)

Student photos

c)

Students exam grade

d)

Student Payment details

29.

Which of the following is described below:

The storage of a value under a declared name these can change.

a)

Variable

b)

Constant

c)

Global Variable

d)

Local Variable

30.

Which of the following is described below:

The storage of a value under a declared name these cannot change.

a)

Variable

b)

Constant

c)

Global Variable

d)

Local Variable

31.

Which of the following is described below:

A variable which is defined and can only be used within one part of the program

a)

Variable

b)

Constant

c)

Global Variable

d)

Local Variable

32.

What type of error produces incorrect results but does not prevent the program from running?

a)

syntax

b)

Logic

c)

Grammatical

d)

Human

33.

What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?

a)

Flowchart

b)

Algorithm

c)

Code

d)

Pseudocode

34.

The line continuation character is a _____.

a)

#

b)

%

c)

&

d)

\

35.

Which mathematical operator is used to raise five to the second power in Python?

a)

/

b)

**

c)

^

d)

''

36.

A(n) _____ is a set of real-world objects, parties, and major events related to the problem.

a)

class

b)

problem domain

c)

object

d)

instance

37.

What type of method provides a safe way for code outside a class to retrieve the values of attributes, without exposing the attributes in a way that they could be changed by the code outside the method?

a)

Accessor

b)

Mutator

c)

Setter

d)

Class

38.

What attributes belong to a specific instance of the class?

a)

instance

b)

self

c)

object

d)

data

39.

What is the special name given to the method that returns a string containing the object’s state?

a)

__state__

b)

__obj__

c)

__str__

d)

__init__

40.

Which method is automatically executed when an instance of the class is created in memory?

a)

__state__

b)

__obj__

c)

__str__

d)

__init__

41.

When a method is called, what does Python make to reference the specific object on which the method is supposed to operate?

a)

state variable

b)

self parameter

c)

object data

d)

init procedure

42.

What type of programming contains class definitions?

a)

procedural

b)

object

c)

object-oriented

d)

modular

e)

pygame

43.

What is, conceptually, a self-contained unit that consists of data attributes and methods that operate on the data attributes?

a)

class

b)

object

c)

instance

d)

module

e)

inheritance

44.

What are the procedures that an object performs called?

a)

methods

b)

actions

c)

modules

d)

instances

e)

verbs

45.

What is the combining of data and code in a single object known as?

a)

modularity

b)

Instantiation

c)

Encapsulation

d)

Objectification

e)

inheritance

46.

What is another name for the mutator methods?

a)

setters

b)

getters

c)

instances

d)

attributes

e)

constructors

47.

What is another name for the accessor methods?

a)

setters

b)

getters

c)

instances

d)

attributes

e)

inheritance

48.

Which pygame function is used to set the size of the window?

a)

pygame.display.set_mode()

b)

pygame.display.set_size()

c)

pygame.display.set_screen()

d)

none

49.

The python module used for making games is -

a)

OpenCV

b)

unity

c)

numpy

d)

pygame

50.

Which function of pygame is used to set the title ?

a)

pygame.display.set_title()

b)

pygame.display.set_caption()

c)

pygame.display.set_name()

d)

none

51.

Which function in pygame is used to set the text position in the screen ?

a)

gamewindow.set_position()

b)

gamewindow.render()

c)

gamewindow.blit()

d)

none

52.

Which function in pygame is used to draw rectangle ?

a)

pygame.draw_rect()

b)

pygame.draw.rectangle()

c)

pygame.draw.rect()

d)

none

53.

How many arguments are there in drawing the rectangle ?

a)

3

b)

4

c)

5

d)

6

54.

Which function in pygame is used to make changes to the window ?

a)

pygame.window.update()

b)

pygame.display.change()

c)

pygame.display.change()

d)

pygame.display.update()

55.

Which tuple of RGB code is representing the color black ?

a)

(255,255,255)

b)

(0,0,0)

c)

(0,0,255)

d)

(0,255,0)

56.

Which pygame function is used to change the font of the text ?

a)

pygame.font.sys_font()

b)

pygame.font()

c)

pygame.font.system_font()

d)

pygame.font.sys_font()

57.

Which pygame function is used to quit the python window ?

a)

pygame.exit()

b)

pygame.terminate()

c)

pygame.quit()

d)

pygame.close()

58.

What does the following command do?

pygame.image.load()

a)

Displays an image on the window

b)

Loads an image from a file

c)

Updates the window

d)

all of the above

59.

How can we load a sound file in pygame?

a)

pygame.add.Sound()

b)

pygame.sound.load()

c)

pygame.mixer.sound()

d)

pygame.mixer.Sound()

60.

Every cycle of the game loop is called a (a)  

61.

All user input results in an event being generated except for one.

a)

key presses

b)

mouse movements

c)

voice input

d)

joystick movements

62.

The term blit stands for _________ and .blit() is how you copy the contents of one Surface to another.

a)

image flipping

b)

fill the background

c)

block transfer

d)

none

63.

What do you mean by sprite in PyGame?

a)

a softdrink

b)

a 2D representation of something on the screen

c)

the player's starting point

d)

an obstacle in the game

64.

The computational problem of detecting the intersection of two or more objects?

a)

object transformation

b)

intersecting objects

c)

collision detection

d)

object converge

65.

The number of frames handled each second is called the _____________, and getting this right is the difference between a playable game and a forgettable one.

a)

frame rate

b)

time clock

c)

clocking speed

d)

frame buffer

66.

It contains code that performs event handling, updates the game world's state, and draws the game world's state to the screen. This is done many times a second.

a)

Game Loop

b)

Game Library

c)

Game Time

d)

Game Structure

67.

An error caused when a recursive function does not have a base case.

(a)  

68.

What would this out put? print(users[0][0])

a)

smith

b)

ben

c)

sam

d)

james

69.

What would this out put? print(users[2][1])

a)

error

b)

16

c)

brown

d)

smith

70.

What would this out put? print(users[3][0])

a)

error

b)

james

c)

brown

d)

16

71.

What would this out put? Print(users[0][0])

a)

james

b)

error

c)

sam

d)

23

72.

What would this out put? print(users[0][0])

a)

smith

b)

ben

c)

error

d)

sam

73.

What would this out put? print(users[1][1])

a)

ben

b)

james

c)

smith

d)

78

74.

What would this out put? print(users[0][2])

a)

23

b)

ben

c)

sam

d)

smith

75.

What would this out put? print(user2[0])

a)

sam

b)

ben

c)

error

d)

23

76.

What would this out put? print(user[0][0])

a)

error

b)

user1

c)

sam

d)

ben

77.

What would this out put? print(users1)

a)

error

b)

sam, smith, 23

c)

ben, smith, 78

d)

ben

78.

A two-dimensional array Array_2d consists of data: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]. What is the output of len(print(Array_2d[2])?

a)

1

b)

3

c)

4

d)

12

79.

Which of the following usees FIFO method

a)

Queue

b)

stack

c)

linklist

d)

binary tree

80.

This form of access is used to add and remove nodes from a queue.

a)

LIFO, Last In First Out

b)

FIFO, First In First Out

c)

Both a and b

d)

none

81.
........ form of access is used to add remove nodes from a stack.
a)
LIFO
b)
Fifo
c)
none
d)
all
82.

Consider the following operation performed on a stack of size 5.

Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);

After the completion of all operation, the number of elements present on stack are

a)

1

b)

2

c)

3

d)

4

83.

What method is used to add an element to a Queue?

a)

dequeue()

b)

enqueue()

c)

push()

d)

pop()

84.

What method is used to add an element to a Stack?

a)

dequeue()

b)

enqueue()

c)

push()

d)

pop()

85.

What method is used to remove an element from a Queue?

a)

dequeue()

b)

enqueue()

c)

push()

d)

pop()

86.

What method is used to view the next element to be removed from a stack?

a)

dequeue()

b)

NextItem()

c)

peek()

d)

pop()

87.

If I want to find out if an item is in a queue or a stack - what do I call?

a)

Contains(item)

b)

IsContains(item)

c)

Peek(item)

d)

Find(item)

88.

What is the reason for using a circular queue instead of a regular queue?

a)

running time of enqueue is improved

b)

reuse empty space

c)

you can traverse the elements more efficiently

d)

none of the above

89.

One difference between stack and queue?

a)

queues require dynamic memory,but stack do not

b)

stacks use two ends of the structure,queue use only one

c)

stacks requires dynamic memory ,but queues do not

d)

queues uses two ends of the structure,stack use only one

90.

If the element "A B C D" are placed in a stack and are deleted one at a time

in what order will they be removed?

a)

ABCD

b)

DBCA

c)

DCBA

d)

DABC

91.

A data structure in which elements can be inserted or deleted at/from

both the ends but not in the middle is?

a)

queue

b)

circular queue

c)

dequeue

d)

priority queue

92.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
93.

Which of the following keywords marks the begining of the function block?

a)

Func

b)

define

c)

def

d)

function

94.

Which of the following best describes a Constant Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

95.

Which of the following best describes a Linear Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

96.

Which of the following best describes a Polynomial Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

97.

Which of the following best describes a Exponential Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

98.

Which of the following best describes a Logarithmic Big-O notation?

a)

This means that the Size of the data set does not impact the Time complexity remains the same.

b)

This means that Size of the data set increases so does the Time Complexity at the same rate.

c)

This means that as the Size of the data set increases the algorithm takes much more time to run.

d)

This means as algorithm takes increasingly more Time to run as the data set increases.

e)

This means the data set takes a decreasing amount of Time more to complete as the data set increases,

99.

Which of the following best describe Linear Search:

a)

Very simple algorithm to code.

b)

Best suited to small lists.

c)

Not very efficient as it has to search every item individually

d)

Can only be used on ordered lists.

e)

This is more suitable to larger lists.

100.

Which of the following best describe Binary Search:

a)

Very simple algorithm to code.

b)

Best suited to small lists.

c)

Efficient, in general takes less steps

d)

Can only be used on ordered lists.

e)

This is more suitable to larger lists.

101.

Which algorithm is outlined below:

A simple sorting algorithm that builds the final sorted array (or list) one item at time. It is much less efficient on large lists than more advanced algorithms.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

102.

Which algorithm is outlined below:

A type of divide and conquer algorithm that was incited by John von Neumann. First the list is divided into the smallest unit (1 element), then each element is compared with the adjacent list to sort and merge the two adjacent lists.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

103.

Which sorting algorithm is shown in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

104.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

105.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

106.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

107.


Which
algorithm is shown in the code in the image?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

108.


Which
algorithm is described below:

1) Look at the first two items in the list.

2) If they are in the right order, leave them as they are. If they are in the wrong order, swap them round.

3) Move on to the next pair of numbers and repeat step 2).

4) Repeat step 3) until you get to the end of the list. Each time you go through all of the cards is called a pass.

5) Repeat steps 1) – 4) until you get a full pass without any swaps.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

109.


Which
algorithm is described below:

1) Look at the second item in a list.

2) Compare it to all the items before it and insert it into the right place.

3) Repeat step 2) for all items that are sorted. When all the items have been compared the list is sorted.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

110.


Which
algorithm is described below:

1) Split the list in half.

2) Repeat step 1) on all sub-lists contain only one item.

3) Merge pairs of sub-lists, Each time pairs merge sort them into the correct order.

4) Repeat step 3) until all sub-lists have been merged together.

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

111.


Which
algorithm is described below:

1) Set a pointer to the first and last item in the list.

2) While the first pointer is not equal to the second pointer (list of 1) then

2a) If the items at the pointers are in the wrong order, swap the items and the pointers.

2b) Move the first pointer one item towards the second pointer.

3) Repeat from step 1 on the list of items to the left of the pointer.

4) Repeat from step 1 on the list of items from the pointer

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Quick Sort

112.

Which of the following are the advantages of an Bubble sort?

a)

A simple algorithm, that can easily be used.

b)

Can efficiently check if a list is already in order.

c)

Does not use much computer memory.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

113.

Which of the following are the advantages of an Insertion sort?

a)

Copes very well with small lists. Often paired with merge sorts to highlight each's advantages.

b)

Requires very little memory to run.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

114.

Which of the following are the advantages of an Merge sort?

a)

Much more efficient than Bubble and insertion sorts on large lists.

b)

Requires very little memory to run.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

115.

Which of the following are the advantages of a Quick sort?

a)

Useful for sorting arrays fast

b)

Does not take up a lot of storage space.

c)

Very quick to add new items into an already sorted list.

d)

Consistent runtime regardless of how unorganised the list is.

e)

Intuitive way to sort data whilst being easily coded.

116.

Which Data Structure is described below:

A list of values that can be ordered and can change.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

117.

Which Data Structure is described below:

A list of values that are arrange as either 1D, 2D or 3D.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue

118.

Which Data Structure is described below:

Values stored in a LIFO order.

a)

Tuple

b)

List

c)

Array

d)

Stack

e)

Queue