wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSNP-04103 C++ Chapter 11 - Templates and Object Oriented

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Template functions are used to:

a)

Call other functions easily.

b)

be able to work with template classes

c)

Create a single function that will use abstract data types.

d)

Creates a template to be able to use multiple functions

2.

Template classes are used for:

a)

Be able to use template functions inside the class

b)

Create multiple classes using a specific template

c)

Template classes do not exist, template functions is the right term.

d)

Be able to use a class with abstract data types.

3.

Object Oriented Design provides:

a)

Abstraction

b)

Ability to re-use and share code

c)

Encapsulation

d)

All of the above

4.

Which ones are steps of object oriented design ?

a)

Implement each object.

b)

Create the scope of the implementation

c)

Identify objects and define the service provided by each one

d)

None of the above

5.

Operators overloading applied to classes allow us:

a)

Use multiple classes in a single program

b)

Use traditional operators with abstract data types

c)

Perform mathematical operations inside a class

d)

all of the above

6.

A friend of a class is declared

a)

Inside the class that will be used by the friend function.

b)

In the main program

c)

in the function prototype

d)

None of the above

7.

Can vectors be initialized with different values as you do with arrays?.

a)

No

b)

Yes

8.

Can vectors be resized ?

a)

Yes

b)

No

9.

What library do you need to include to use vectors?.

a)

None, it is part of the C++ standard

b)

<varray>

c)

<vector>

d)

<array_vector>

10.

What is a pointer ?

a)

An object that stores the address (points) to another object such as a variable.

b)

It is a variable by value

c)

It is a C++ object

d)

None of the above