Font size
WorksheetsCSNP-04103 C++ Chapter 11 - Templates and Object Oriented
Total questions: 10
Worksheet time: 5mins
Template functions are used to:
Call other functions easily.
be able to work with template classes
Create a single function that will use abstract data types.
Creates a template to be able to use multiple functions
Template classes are used for:
Be able to use template functions inside the class
Create multiple classes using a specific template
Template classes do not exist, template functions is the right term.
Be able to use a class with abstract data types.
Object Oriented Design provides:
Abstraction
Ability to re-use and share code
Encapsulation
All of the above
Which ones are steps of object oriented design ?
Implement each object.
Create the scope of the implementation
Identify objects and define the service provided by each one
None of the above
Operators overloading applied to classes allow us:
Use multiple classes in a single program
Use traditional operators with abstract data types
Perform mathematical operations inside a class
all of the above
A friend of a class is declared
Inside the class that will be used by the friend function.
In the main program
in the function prototype
None of the above
Can vectors be initialized with different values as you do with arrays?.
No
Yes
Can vectors be resized ?
Yes
No
What library do you need to include to use vectors?.
None, it is part of the C++ standard
<varray>
<vector>
<array_vector>
What is a pointer ?
An object that stores the address (points) to another object such as a variable.
It is a variable by value
It is a C++ object
None of the above
