CS304 Midterm Online Quiz

0%

CS304-Midterm

1 / 50

Which part of an object exhibits its state?

2 / 50

template <> class Vector { } This is an example of partial specialization

3 / 50

Static variable can be initialized more than once

4 / 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?

5 / 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

6 / 50

Which is not the Advantage of inheritance?

7 / 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?

8 / 50

A generalization-specialization relation between classes are implemented using

9 / 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,

10 / 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?

11 / 50

To convert from a user-defined class to a basic type, you would most likely use

12 / 50

Which operator can not be overloaded?

13 / 50

 _______ remain in memory even when all objects of a class have been destroyed

14 / 50

this pointers are not accessible for static member functions

15 / 50

Using encapsulation we can achieve

16 / 50

The technique in which we visualize our programming problems according to real life’s problems is called ----------------

17 / 50

________ is/are used to access information hidden within an object?

18 / 50

this pointers are not accessible for static member functions

19 / 50

What a derived class can add?

20 / 50

Which of the following operators always takes no argument if overloaded? 

21 / 50

A non-virtual member function is defined in a base class and overridden in a derived class; if that function is called through a base-class pointer to a derived class object, the derived-class version is used

22 / 50

The statement objA=objB; will cause a compiler error if the objects are of different classes

23 / 50

Inheritance is a way to - Please choose one

24 / 50

Constant objects cannot change their state,

25 / 50

The return type of a constructor is of -------------

26 / 50

__________ provide the facility to access the data member

27 / 50

Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract

28 / 50

a’A static member function can be called, even when a class is not __________

29 / 50

 Which one is not keyword in C++?

30 / 50

The compiler won’t object if you overload the * operator to perform division

31 / 50

In order to free the memory occupied by the object, we use -------------

32 / 50

In OOP a class is an example of _____ 

33 / 50

We can get only one unique value which can be used by all the objects of that class by the use of,

34 / 50

A class can be identified from a statement by -------------

35 / 50

The ________ relationship indicates that an object contains other objects

36 / 50

The >= operator can be overloaded

37 / 50

C++ compiler does not allow to dynamically allocate memory for objects

38 / 50

A generalization-specialization relation between classes are implemented using

39 / 50

Which of the following is not an example of multiple inheritances?----------

40 / 50

An overloaded operator always requires one less argument than its number of operands

41 / 50

__________ satisfy the condition of polymorphism

42 / 50

A static member function cannot be declared

43 / 50

If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the _____ class to be executed

44 / 50

What problem(s) may occur when we copy objects without using deep copy constructor?

45 / 50

C++ compiler does not allow to dynamically allocate memory for objects

46 / 50

Static variable can be initialized more than once.

47 / 50

 Which one is not keyword in C++?

48 / 50

Which one of the following is not an object association?

49 / 50

What problem(s) may occur when we copy objects without using deep copy constructor?

50 / 50

Which of the following may not be an integral part of an object?

Your score is

The average score is 0%

0%

Qunoot e Nazilah
Dua e Hajat
4 Qul
6 Kalma
Dua-e-Akasha
Darood Akbar
Surah Fatiha
Dua-e-Ganj Ul Arsh
Dua-e-Jamilah
Ayat-ul-Kursi