0% found this document useful (0 votes)
75 views9 pages

CS304 Quiz#2 by @studywithhamza25

The document provides quiz questions and answers about object-oriented programming concepts like classes, static members, pointers, inheritance and composition. It also contains information about subscribing to a YouTube channel for more practice quizzes.

Uploaded by

1 dm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views9 pages

CS304 Quiz#2 by @studywithhamza25

The document provides quiz questions and answers about object-oriented programming concepts like classes, static members, pointers, inheritance and composition. It also contains information about subscribing to a YouTube channel for more practice quizzes.

Uploaded by

1 dm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CS304 Quiz#02

LATEST ATTEMPT BY
@studywithhamzA25
PAID QUIZ CONTACT
03147094561
Marks Gurantee 80%to100%
LMS HANDLING SERVICES AVAILABLE
Join Whatsapp Group For Latest Solutions
https://www.youtube.com/@studywithhamza25

WHATSAPP GROUP1
Join NOW
WHATSAPP GROUP 2
Join NOW
Join WHATSAPP CHANNEL
JOIN NOW

In OOP, static data members of a class are called


____________ variables.
a. Object
b. Function
c. Class @studywithhamza25
d. Structure
Which of the following stores the address of a variable?
a. Pointer @studywithhamza25
b. Function
c. Destructor
d. Constructor
Which of the following function declaration is correct to
overload the + operator as member function in Complex
class?
a. Complex +(const Complex & rhs);
b. operator + Complex (const Complex & rhs);
c. Complex operator + ::(const Complex & rhs);
d. Complex operator +(const Complex & rhs);
@studywithhamza25
Which of the following statement is TRUE about a class's
Static Member Function?
a. It can access constant data members of the class.
b. It can access non-static data members.
c. It is used to access static data members only.
@studywithhamza25
d. It can only be called by a particular object of class.
We can get the address of a variable stored in a pointer
using __________:
a. ->symbol
b. & symbol @studywithhamza25
c. * symbol
d. :: symbol
Suppose we have a class named “Test” and void show() is
one of its public member function. Which of the following
is a correct way to call show() function using Test pointer
ptr?
a. ptr.show();
b. ptr->show(); @studywithhamza25
c. ptr:show();
d. ptr::show();
Static Data Members can be accessed through _________.
a. Semi colon
b. Scope resolution operator @studywithhamza25
c. Dot operator and scope resolution operator
d. Dot operator
In composition ____________ are called from composed
objects to composing objects.
a. Constructors
b. Pointers
c. Variables
d. Destructors @studywithhamza25
Suppose we have a class named “Student”; which of the
following statement is correctly declaring the pointer to
the object for “Student” class?
a. Student*obj; @studywithhamza25
b. Student obj;
c. Student &obj;
d. *Student obj;
_______ remain in memory even when all objects of a
class have been destroyed.
a. Instance Data Members
b. Static Data Members @studywithhamza25
c. Primitive Variables
d. Constant Data Members
Static Data Members can be accessed through _________.
a. Dot operator and scope resolution operator
@studywithhamza25
b. Scope resolution operator
c. Semi colon
d. Dot operator
Which of the following best describes relationship
between Book and BookChapter classes?
a. Association
b. Aggregation
c. Inheritance
d. Composition @studywithhamza25
Suppose we have a class named “Student”; which of the
following statement is correctly declaring the pointer to
the object for “Student” class?
a. Student obj;
b. Student &obj;
c. Student * obj; @studywithhamza25
d. * obj;
In composition ____________ are called from composed
objects to composing objects.
a. Variables
b. Pointers
c. Destructors
d. Constructors @studywithhamza25
Which of the following is the correct way of declaring a
constant variable named RollNo?
a. const int RollNo;
b. const RollNo;
c. int RollNo const;
d. int const rollNo; @studywithhamza25
_____ is creating objects of one class inside another class.
a. Inheritance
b. Composition @studywithhamza25
c. Aggregation
d. Association
We can get the address of a variable stored in a pointer using
__________
a. @studywithhamza25 symbol
b. :: symbol
c. & symbol @studywithhamza25
d. ->symbol
We can access a private static data member of a class
through _________________.
a. Static member function @studywithhamza25
b. Global member function
c. Global data member
d. Static data member
Suppose we have a class named “Test” and void show() is
one of its public member function. Which of the following
is a correct way to call show() function using Test pointer
ptr?
a. ptr->show(); @studywithhamza25
b. ptr:show();
c. ptr::show();
d. ptr.show();
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.

a. Rational_number operator+(Rational_number &obj, double&


num); @studywithhamza25
b. operator+(double& obj);
c. None of the given choices
d. Rational_number operator+( Rational_number & obj);
SUBSCRIBE MY YOUTIBE
CHANNEL

SubSCRIBE NOW
THANK YOU!

You might also like