NEW
Font size
WorksheetsL6 Data Representation and OO
Total questions: 21
Worksheet time: 11mins
In fixed point signed binary, which number is larger 10001.11 or 011.01
10001.11
011.01
Multiply binary 1101 by denary 17:
11011101
11010000
110111
11011111
Which number is the biggest in floating point with 3 bits for mantissa and 3 bits for exponent?
101 101
011 011
001 001
101 011
Which number is the smallest in floating point with 3 bits for mantissa and 3 bits for exponent?
101 101
011 011
001 001
101 011
Which number is the closest to zero in floating point with 3 bits for mantissa and 3 bits for exponent?
101 101
011 011
001 001
101 011
Why would you choose a fixed point representation over a floating point representation?
Larger range of values can be represented
Faster arithmetic
Why do you normalize floating point numbers?
To make calculations faster
To make comparisons faster
To reduce errors
What shape arrow do you use to show inheritance?
Triangular arrow
Filled diamond arrow
Empty diamond arrow
Line with no arrow
What shape arrow do you use to show composition?
Triangular arrow
Filled diamond arrow
Empty diamond arrow
Line with no arrow
What shape arrow do you use to show aggregation?
Triangular arrow
Filled diamond arrow
Empty diamond arrow
Line with no arrow
What shows a protected class member in a UML diagram?
plus
minus
hash
dot
What shows a private class member in a UML diagram?
plus
minus
hash
dot
What shows a public class member in a UML diagram?
plus
minus
hash
dot
What is a class?
A data type which combines data and functions to act on that data
An object which combines data and functions to act on that data
An instance which is a given data type
What is the name of the method called when an instance of an object is created
Constructor
Bulider
Maker
Creator
How do you show a private property in Python
with double underscores
with a single underscore
with a @property decorator
with a @setter
How do you define a getter method in Python?
with the @property decorator
with double underscores
with single underscores
How do you show that a Triangle class inherits from a Shape class in Python?
class Shape(Triangle):
class Triangle(Shape):
class Shape is_a Triangle:
def __init__Shape(Triangle):
What is abstraction where details are omitted?
Representational abstraction
Abstraction by generalization
Information hiding
Inheritance
What is abstraction where common properties of objects are used?
Representational abstraction
Abstraction by generalization
Information hiding
Inheritance
If given the option, should you favour inheritance or composition?
Inheritance
Composition
