CS304-Midterm
1 / 50
Inheritance is a way to - Please choose one
2 / 50
Given the following class class Base{ int Age=33; } How you can improve above class with respect to accessing the field Age?
3 / 50
The ________ relationship indicates that an object contains other objects
4 / 50
Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b?
5 / 50
Which operator can not be overloaded?
6 / 50
Which of the following is not an example of multiple inheritances?----------
7 / 50
We capture the object attributes and behavior in Object Oriented programming using---------------
8 / 50
Which one is not keyword in C++?
9 / 50
An overloaded operator always requires one less argument than its number of operands
10 / 50
We can get only one unique value which can be used by all the objects of that class by the use of,
11 / 50
Identify which of the following overloaded operator function’s declaration is appropriate for the given call? Rational_number_1 + 2.325 Where Rational_number_1 is an object of user defined class Rational_number
12 / 50
The life of sub object is not dependant on the life of master class in ___________
13 / 50
Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract
14 / 50
The members of a class that can be accessed without creating the object of the class is called
15 / 50
Static variables act like a global variable in the context or scope of the class
16 / 50
A generalization-specialization relation between classes are implemented using
17 / 50
To convert from a user-defined class to a basic type, you would most likely use
18 / 50
For classes with common behavior, you can save effort by placing the common behavior in a __________
19 / 50
The technique in which we visualize our programming problems according to real life’s problems is called ----------------
20 / 50
________ is/are used to access information hidden within an object?
21 / 50
The >= operator can be overloaded.
22 / 50
What a derived class can add?
23 / 50
When a variable is define as static in a class then all object of this class,
24 / 50
25 / 50
26 / 50
Which part of an object exhibits its state?
27 / 50
A member function having the same name as that of a class and a ~ sign with it is called,
28 / 50
The >= operator can be overloaded
29 / 50
Inheritance is a way to
30 / 50
A static member function cannot be declared
31 / 50
Consider the code below, class Fred { public: Fred(); ... }; int main() { Fred a[10]; Fred* p = new Fred[10]; ... } Select the best option,
32 / 50
The statement objA=objB; will cause a compiler error if the objects are of different classes
33 / 50
We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are careful,
34 / 50
_______ is a relationship
35 / 50
A class can be identified from a statement by -------------
36 / 50
If you define a vector v with the default constructor, and define another vector w with a one-argument constructor to a size of 11, and insert 3 elements into each of these vectors with push_back(), then the size() member function will return ______ for v and _____ for w
37 / 50
We achieve independence of internal implementation from its external interface through-----------
38 / 50
39 / 50
Friend functions are _____________ functions of a class
40 / 50
41 / 50
What is true about function templates?
42 / 50
__________ provide the facility to access the data member
43 / 50
44 / 50
Friend class and friend function can be used as an alternate to each other
45 / 50
In OOP a class is an example of _____
46 / 50
Which one of the following terms must relate to polymorphism?
47 / 50
Which of the following may not be an integral part of an object?
48 / 50
49 / 50
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access
50 / 50
___________, which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A
Your score is
The average score is 0%
Restart quiz