CS304-Midterm
1 / 50
Given the following class class Base{ int Age=33; } How you can improve above class with respect to accessing the field Age?
2 / 50
Which of the following may not be an integral part of an object?
3 / 50
A member function having the same name as that of a class and a ~ sign with it is called,
4 / 50
Which is not the Advantage of inheritance?
5 / 50
Which of the following is not an example of multiple inheritances?----------
6 / 50
this pointers are not accessible for static member functions
7 / 50
Which of the following operators always takes no argument if overloaded?
8 / 50
Suppose there is an object of type Person, which of the following can be considered as one of its attributes
9 / 50
A class can be identified from a statement by -------------
10 / 50
C++ compiler does not allow to dynamically allocate memory for objects
11 / 50
Which part of an object exhibits its state?
12 / 50
Inheritance is a way to
13 / 50
_______ remain in memory even when all objects of a class have been destroyed
14 / 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
15 / 50
When a variable is define as static in a class then all object of this class,
16 / 50
Which operator can not be overloaded?
17 / 50
Suppose you have been given the following design, "A person has a name, age, address and sex. You are designing a class to represent a type of person called a patient. This kind of person may be given a diagnosis, have a spouse and may be alive". Given that the person class has already been created, what of the following would be appropriate to include when you design the patient class?
18 / 50
Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator must
19 / 50
What a derived class can add?
20 / 50
The >= operator can be overloaded
21 / 50
22 / 50
In order to free the memory occupied by the object, we use -------------
23 / 50
The life of sub object is not dependant on the life of master class in ___________
24 / 50
The technique in which we visualize our programming problems according to real life’s problems is called ----------------
25 / 50
The find() algorithm
26 / 50
We capture the object attributes and behavior in Object Oriented programming using---------------
27 / 50
The >= operator can be overloaded.
28 / 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
29 / 50
30 / 50
The return type of a constructor is of -------------
31 / 50
The compiler won’t object if you overload the * operator to perform division
32 / 50
The concept of derived classes is involved in,
33 / 50
34 / 50
In order to define a class template, the first line of definition must be:
35 / 50
A static member function cannot be declared
36 / 50
37 / 50
38 / 50
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
39 / 50
A generalization-specialization relation between classes are implemented using
40 / 50
41 / 50
Static variables act like a global variable in the context or scope of the class
42 / 50
Constant objects cannot change their state,
43 / 50
Inheritance is a way to - Please choose one
44 / 50
An overloaded operator always requires one less argument than its number of operands
45 / 50
46 / 50
Static variable can be initialized more than once.
47 / 50
48 / 50
To convert from a user-defined class to a basic type, you would most likely use
49 / 50
Which one of the following is not an object association?
50 / 50
_______ is a relationship
Your score is
The average score is 0%
Restart quiz