CS-304 Final Term Exams Preparation Virtual University With Answers

image
image
image

CS-304 Final Term Exams Preparation Virtual University

Sr. # Questions Answers Choice
1 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. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); Rational_number operator+(Rational_number &obj, double& num); operator+(double& obj);
2 The statement objA=objB; will cause a compiler error if the objects are of different classes. True False Not Sure
3 ___________, 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. Friendship is one way only Friendship is two way only NO Friendship between classes Any kind of friendship
4 Friend functions are _____________ functions of a class. None of given object member non-member data member
5 _______ remain in memory even when all objects of a class have been destroyed. Static variables Instance variable Primitive variables None of given
6 A static member function cannot be declared. Static Implicit Explicit Virtual
7 this pointers are not accessible for static member functions. True False Not Sure
8 What problem(s) may occur when we copy objects without using deep copy constructor? Dangling pointe Memory Leakage All of the given System crash
9 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? registration date and diagnosis age and sex sex and diagnosis diagnosis and age
10 Which part of an object exhibits its state? Data Operations Any public part Any private part
Download This Set