wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

L6 Data Representation and OO

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

In fixed point signed binary, which number is larger 10001.11 or 011.01

a)

10001.11

b)

011.01

2.

Multiply binary 1101 by denary 17:

a)

11011101

b)

11010000

c)

110111

d)

11011111

3.

Which number is the biggest in floating point with 3 bits for mantissa and 3 bits for exponent?

a)

101 101

b)

011 011

c)

001 001

d)

101 011

4.

Which number is the smallest in floating point with 3 bits for mantissa and 3 bits for exponent?

a)

101 101

b)

011 011

c)

001 001

d)

101 011

5.

Which number is the closest to zero in floating point with 3 bits for mantissa and 3 bits for exponent?

a)

101 101

b)

011 011

c)

001 001

d)

101 011

6.

Why would you choose a fixed point representation over a floating point representation?

a)

Larger range of values can be represented

b)

Faster arithmetic

7.

Why do you normalize floating point numbers?

a)

To make calculations faster

b)

To make comparisons faster

c)

To reduce errors

8.

What shape arrow do you use to show inheritance?

a)

Triangular arrow

b)

Filled diamond arrow

c)

Empty diamond arrow

d)

Line with no arrow

9.

What shape arrow do you use to show composition?

a)

Triangular arrow

b)

Filled diamond arrow

c)

Empty diamond arrow

d)

Line with no arrow

10.

What shape arrow do you use to show aggregation?

a)

Triangular arrow

b)

Filled diamond arrow

c)

Empty diamond arrow

d)

Line with no arrow

11.

What shows a protected class member in a UML diagram?

a)

plus

b)

minus

c)

hash

d)

dot

12.

What shows a private class member in a UML diagram?

a)

plus

b)

minus

c)

hash

d)

dot

13.

What shows a public class member in a UML diagram?

a)

plus

b)

minus

c)

hash

d)

dot

14.

What is a class?

a)

A data type which combines data and functions to act on that data

b)

An object which combines data and functions to act on that data

c)

An instance which is a given data type

15.

What is the name of the method called when an instance of an object is created

a)

Constructor

b)

Bulider

c)

Maker

d)

Creator

16.

How do you show a private property in Python

a)

with double underscores

b)

with a single underscore

c)

with a @property decorator

d)

with a @setter

17.

How do you define a getter method in Python?

a)

with the @property decorator

b)

with double underscores

c)

with single underscores

18.

How do you show that a Triangle class inherits from a Shape class in Python?

a)

class Shape(Triangle):

b)

class Triangle(Shape):

c)

class Shape is_a Triangle:

d)

def __init__Shape(Triangle):

19.

What is abstraction where details are omitted?

a)

Representational abstraction

b)

Abstraction by generalization

c)

Information hiding

d)

Inheritance

20.

What is abstraction where common properties of objects are used?

a)

Representational abstraction

b)

Abstraction by generalization

c)

Information hiding

d)

Inheritance

21.

If given the option, should you favour inheritance or composition?

a)

Inheritance

b)

Composition