Font size
WorksheetsY12 OOP-FLT-STK-Q-PRG mmd
Total questions: 118
Worksheet time: 1hrs 16mins
What is the binary number 0111 1101 in hexadecimal?
AC
9C
9D
8B
Which of these is a floating point number?
3
3.0
7
5.6
100101000011 (8 bit signed mantissa / 4 bit signed exponent) what is the decimal number?
9.25
-9.25
-6.75
6.75
What is the normalised form of 0.0000111 0111
1.0110000 0011
1.0110000 0111
0.1110000 0111
0.1110000 0011
Add 0.1100000 0001 and 0.1111100 0011 and normalise the result.
1001.0100 0100
0.1001010 0100
1.0010100 0100
0.1010100 0111
You can change an object members via its:
methods
attributes
modifiers
parameters
an object is being instantiated
What is an object?
Everything
An instance of a class
A detail of a class
A class of details
A method is...
A way of calculating things in Java
A strategy for programming
A predefined set of instructions in a class
A way to sore details in a class
What does an object consist of?
Methods
Subs and Members (Attributes)
Methods and Members (Attributes)
Procedures
Variables
A Parent or Super Class is...
A class about children
A class which other classes can inherit functionality from
A class which other classes can inherit members from
A private class
Multiple methods (of the same name) which can receive different types or numbers of parameters is known as:
Overriding
Overcasting
Overloading
Overworking
We extend a class using:
Spaces
Inheritance
Overloading
Branching
...is where an object instantiated of a parent class can also be an instance of a derived class.
Polytechnic
Polycoding
Polymoreism
Polymorphism
Which of the following statements is describing the skill of, 'thinking abstractly'?
Breaking a problem down
Identifying the preconditions of a system, the inputs, outputs and reusable components
Removing unnecessary details and including only the relevant details
Identifying decision points for branching or iteration
Means solving problems at the same time.
Which of the following statements is describing the skill of, 'thinking ahead'?
Breaking a problem down
Identifying the preconditions of a system, the inputs, outputs and reusable components
Removing unnecessary details and including only the relevant details
Identifying decision points for branching or iteration
Means solving problems at the same time.
Which of the following statements is describing the skill of, 'thinking procedurally'?
Breaking a problem down, allowing them the smaller problems to be solved.
Identifying the preconditions of a system, the inputs, outputs and reusable components
Removing unnecessary details and including only the relevant details
Identifying decision points for branching or iteration
Means solving problems at the same time.
Which of the following statements is describing the skill of, 'thinking logically'?
Breaking a problem down, allowing them the smaller problems to be solved.
Identifying the preconditions of a system, the inputs, outputs and reusable components
Removing unnecessary details and including only the relevant details
Identifying decision points for branching or iteration
Means solving problems at the same time.
Which of the following statements is describing the skill of, 'thinking concurrently'?
Breaking a problem down, allowing them the smaller problems to be solved.
Identifying the preconditions of a system, the inputs, outputs and reusable components
Removing unnecessary details and including only the relevant details
Identifying decision points for branching or iteration
Means solving problems at the same time.
What is meant by the term 'abstraction'?
A simplified programming language used in program design
Getting to a solution through the clear definition of the steps needed
Including the necessary details and leaving out the unnecessary details
Breaking a problem down into smaller sub-problems
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?
Abstraction
Reality
Programming
Implementation
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?
Location of petrol and service stations
Names of roads and motorways
Wooded areas illustrated with trees
Place names of towns and cities
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?
Students full names
Student photos
Students exam grade
Student Payment details
Which of the following is described below:
The storage of a value under a declared name these can change.
Variable
Constant
Global Variable
Local Variable
Which of the following is described below:
The storage of a value under a declared name these cannot change.
Variable
Constant
Global Variable
Local Variable
Which of the following is described below:
A variable which is defined and can only be used within one part of the program
Variable
Constant
Global Variable
Local Variable
What type of error produces incorrect results but does not prevent the program from running?
syntax
Logic
Grammatical
Human
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?
Flowchart
Algorithm
Code
Pseudocode
The line continuation character is a _____.
#
%
&
\
Which mathematical operator is used to raise five to the second power in Python?
/
**
^
''
A(n) _____ is a set of real-world objects, parties, and major events related to the problem.
class
problem domain
object
instance
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?
Accessor
Mutator
Setter
Class
What attributes belong to a specific instance of the class?
instance
self
object
data
What is the special name given to the method that returns a string containing the object’s state?
__state__
__obj__
__str__
__init__
Which method is automatically executed when an instance of the class is created in memory?
__state__
__obj__
__str__
__init__
When a method is called, what does Python make to reference the specific object on which the method is supposed to operate?
state variable
self parameter
object data
init procedure
What type of programming contains class definitions?
procedural
object
object-oriented
modular
pygame
What is, conceptually, a self-contained unit that consists of data attributes and methods that operate on the data attributes?
class
object
instance
module
inheritance
What are the procedures that an object performs called?
methods
actions
modules
instances
verbs
What is the combining of data and code in a single object known as?
modularity
Instantiation
Encapsulation
Objectification
inheritance
What is another name for the mutator methods?
setters
getters
instances
attributes
constructors
What is another name for the accessor methods?
setters
getters
instances
attributes
inheritance
Which pygame function is used to set the size of the window?
pygame.display.set_mode()
pygame.display.set_size()
pygame.display.set_screen()
none
The python module used for making games is -
OpenCV
unity
numpy
pygame
Which function of pygame is used to set the title ?
pygame.display.set_title()
pygame.display.set_caption()
pygame.display.set_name()
none
Which function in pygame is used to set the text position in the screen ?
gamewindow.set_position()
gamewindow.render()
gamewindow.blit()
none
Which function in pygame is used to draw rectangle ?
pygame.draw_rect()
pygame.draw.rectangle()
pygame.draw.rect()
none
How many arguments are there in drawing the rectangle ?
3
4
5
6
Which function in pygame is used to make changes to the window ?
pygame.window.update()
pygame.display.change()
pygame.display.change()
pygame.display.update()
Which tuple of RGB code is representing the color black ?
(255,255,255)
(0,0,0)
(0,0,255)
(0,255,0)
Which pygame function is used to change the font of the text ?
pygame.font.sys_font()
pygame.font()
pygame.font.system_font()
pygame.font.sys_font()
Which pygame function is used to quit the python window ?
pygame.exit()
pygame.terminate()
pygame.quit()
pygame.close()
What does the following command do?
pygame.image.load()
Displays an image on the window
Loads an image from a file
Updates the window
all of the above
How can we load a sound file in pygame?
pygame.add.Sound()
pygame.sound.load()
pygame.mixer.sound()
pygame.mixer.Sound()
Every cycle of the game loop is called a (a)
All user input results in an event being generated except for one.
key presses
mouse movements
voice input
joystick movements
The term blit stands for _________ and .blit() is how you copy the contents of one Surface to another.
image flipping
fill the background
block transfer
none
What do you mean by sprite in PyGame?
a softdrink
a 2D representation of something on the screen
the player's starting point
an obstacle in the game
The computational problem of detecting the intersection of two or more objects?
object transformation
intersecting objects
collision detection
object converge
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.
frame rate
time clock
clocking speed
frame buffer
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.
Game Loop
Game Library
Game Time
Game Structure
An error caused when a recursive function does not have a base case.
(a)
What would this out put? print(users[0][0])
smith
ben
sam
james
What would this out put? print(users[2][1])
error
16
brown
smith
What would this out put? print(users[3][0])
error
james
brown
16
What would this out put? Print(users[0][0])
james
error
sam
23
What would this out put? print(users[0][0])
smith
ben
error
sam
What would this out put? print(users[1][1])
ben
james
smith
78
What would this out put? print(users[0][2])
23
ben
sam
smith
What would this out put? print(user2[0])
sam
ben
error
23
What would this out put? print(user[0][0])
error
user1
sam
ben
What would this out put? print(users1)
error
sam, smith, 23
ben, smith, 78
ben
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])?
1
3
4
12
Which of the following usees FIFO method
Queue
stack
linklist
binary tree
This form of access is used to add and remove nodes from a queue.
LIFO, Last In First Out
FIFO, First In First Out
Both a and b
none
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
1
2
3
4
What method is used to add an element to a Queue?
dequeue()
enqueue()
push()
pop()
What method is used to add an element to a Stack?
dequeue()
enqueue()
push()
pop()
What method is used to remove an element from a Queue?
dequeue()
enqueue()
push()
pop()
What method is used to view the next element to be removed from a stack?
dequeue()
NextItem()
peek()
pop()
If I want to find out if an item is in a queue or a stack - what do I call?
Contains(item)
IsContains(item)
Peek(item)
Find(item)
What is the reason for using a circular queue instead of a regular queue?
running time of enqueue is improved
reuse empty space
you can traverse the elements more efficiently
none of the above
One difference between stack and queue?
queues require dynamic memory,but stack do not
stacks use two ends of the structure,queue use only one
stacks requires dynamic memory ,but queues do not
queues uses two ends of the structure,stack use only one
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?
ABCD
DBCA
DCBA
DABC
A data structure in which elements can be inserted or deleted at/from
both the ends but not in the middle is?
queue
circular queue
dequeue
priority queue
Which of the following keywords marks the begining of the function block?
Func
define
def
function
Which of the following best describes a Constant Big-O notation?
This means that the Size of the data set does not impact the Time complexity remains the same.
This means that Size of the data set increases so does the Time Complexity at the same rate.
This means that as the Size of the data set increases the algorithm takes much more time to run.
This means as algorithm takes increasingly more Time to run as the data set increases.
This means the data set takes a decreasing amount of Time more to complete as the data set increases,
Which of the following best describes a Linear Big-O notation?
This means that the Size of the data set does not impact the Time complexity remains the same.
This means that Size of the data set increases so does the Time Complexity at the same rate.
This means that as the Size of the data set increases the algorithm takes much more time to run.
This means as algorithm takes increasingly more Time to run as the data set increases.
This means the data set takes a decreasing amount of Time more to complete as the data set increases,
Which of the following best describes a Polynomial Big-O notation?
This means that the Size of the data set does not impact the Time complexity remains the same.
This means that Size of the data set increases so does the Time Complexity at the same rate.
This means that as the Size of the data set increases the algorithm takes much more time to run.
This means as algorithm takes increasingly more Time to run as the data set increases.
This means the data set takes a decreasing amount of Time more to complete as the data set increases,
Which of the following best describes a Exponential Big-O notation?
This means that the Size of the data set does not impact the Time complexity remains the same.
This means that Size of the data set increases so does the Time Complexity at the same rate.
This means that as the Size of the data set increases the algorithm takes much more time to run.
This means as algorithm takes increasingly more Time to run as the data set increases.
This means the data set takes a decreasing amount of Time more to complete as the data set increases,
Which of the following best describes a Logarithmic Big-O notation?
This means that the Size of the data set does not impact the Time complexity remains the same.
This means that Size of the data set increases so does the Time Complexity at the same rate.
This means that as the Size of the data set increases the algorithm takes much more time to run.
This means as algorithm takes increasingly more Time to run as the data set increases.
This means the data set takes a decreasing amount of Time more to complete as the data set increases,
Which of the following best describe Linear Search:
Very simple algorithm to code.
Best suited to small lists.
Not very efficient as it has to search every item individually
Can only be used on ordered lists.
This is more suitable to larger lists.
Which of the following best describe Binary Search:
Very simple algorithm to code.
Best suited to small lists.
Efficient, in general takes less steps
Can only be used on ordered lists.
This is more suitable to larger lists.
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.
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
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.
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which sorting algorithm is shown in the image?
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which algorithm is shown in the code in the image?
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which algorithm is shown in the code in the image?
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which algorithm is shown in the code in the image?
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which algorithm is shown in the code in the image?
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
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.
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
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.
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
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.
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
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
Bubble Sort
Insertion Sort
Merge Sort
Quick Sort
Which of the following are the advantages of an Bubble sort?
A simple algorithm, that can easily be used.
Can efficiently check if a list is already in order.
Does not use much computer memory.
Consistent runtime regardless of how unorganised the list is.
Intuitive way to sort data whilst being easily coded.
Which of the following are the advantages of an Insertion sort?
Copes very well with small lists. Often paired with merge sorts to highlight each's advantages.
Requires very little memory to run.
Very quick to add new items into an already sorted list.
Consistent runtime regardless of how unorganised the list is.
Intuitive way to sort data whilst being easily coded.
Which of the following are the advantages of an Merge sort?
Much more efficient than Bubble and insertion sorts on large lists.
Requires very little memory to run.
Very quick to add new items into an already sorted list.
Consistent runtime regardless of how unorganised the list is.
Intuitive way to sort data whilst being easily coded.
Which of the following are the advantages of a Quick sort?
Useful for sorting arrays fast
Does not take up a lot of storage space.
Very quick to add new items into an already sorted list.
Consistent runtime regardless of how unorganised the list is.
Intuitive way to sort data whilst being easily coded.
Which Data Structure is described below:
A list of values that can be ordered and can change.
Tuple
List
Array
Stack
Queue
Which Data Structure is described below:
A list of values that are arrange as either 1D, 2D or 3D.
Tuple
List
Array
Stack
Queue
Which Data Structure is described below:
Values stored in a LIFO order.
Tuple
List
Array
Stack
Queue
