CS304P Graded 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
1. <p>Which of the following statement is dealing with
stream extraction operator?</p>
a. <p>cin >> i >>
j;</p>@studywithhamzA25
b. <p>cout>> j;</p>
c. <p>cin<<i;</p>
d. <p>cout << “i= ”<< i
<< “\n”;</p>
2. What is the purpose of new operator?
a. Allocates memory for an object or array
b. Allocates memory for an object or array and returns a
particular pointer@studywithhamzA25
c. Used as return type when an object is created
d. Used to declare any new thing in a program
3. Which of the following is used to get data from the
console?
a. Operator Overloading
b. Stream Extraction operator@studywithhamzA25
c. Stream Insertion operator
d. Binary Operators
4. Which of the following is true about the friend
functions?
a. Friend functions can be placed anywhere in the class
b. Access specifiers has no impact on friend functions or
classes
c. All of the given options
d. Prototypes of friend functions appear in the class
definition. @studywithhamzA25
5. Suppose c1, c2, and c3 are the objects of the Complex
class and we overloaded the + operator.
c3 = c1 + c2;
In this statement, ___________ object will be passed as
argument when + operator is called.
a. c1
b. c2
c. c3
d. c1 and c2@studywithhamzA25
6. . A class defines the cout and stream insertion
operator, is called
a. kstream
b. ostream@studywithhamzA25
c. istream
d. fstream
7. Subscript operator is overloaded as
_________________ of the class and there will be only
one parameter with integer data type.
a. Static Function
b. Member Function@studywithhamzA25
c. Overloading Operator
d. Overriding Function
8. "cout" is an object of ____ class.
a. istream
b. fstream
c. instream
d. ostream@studywithhamzA25
9. Which of the following operator overloading
declaration can be used for pre-increment operators
implemented as member function of the class
Complex?
a. Complex & operator ++ ();
b. Complex &
Complex::operator++();@studywithhamzA25
c. Complex && operator ++ ();
d. None of the given options
10. Which of the following is correct symbol of stream
extraction operator?
a. <<
b. >
c. >>@studywithhamzA25
d. <
11. "cout" is an object of ____ class.
a. fstream
b. instream
c. istream
d. ostream@studywithhamzA25
12. The relationship between container and contained
objects is called ___________.
a. Inheritance
b. Aggregation
c. Association
d. Composition@studywithhamzA25
13. Which of the following is true about the friend
functions?
a. All of the given options
b. Prototypes of friend functions appear in the class
definition. @studywithhamzA25
c. Friend functions can be placed anywhere in the class
d. Access specifiers has no impact on friend functions or
classes
14. A doctor can see patients. This type of relationship
is known as ________.
a. Binary Association@studywithhamzA25
b. Two-way Association
c. One-way Association
d. Ternary Association
15. Which of the following is correct symbol of stream
extraction operator?
a. <
b. >>@studywithhamzA25
c. >
d. <<
16. When an object of a class is the data member of
another class, it is called as _________.
a. aggregation
b. composition@studywithhamzA25
c. inheritance
d. Association
17. In which order are constructors and destructors
called in a derived class inheriting from a base class?
a. Base class constructor, Derived class constructor,
Derived class destructor, Base class destructor
b. Derived class constructor, Base class constructor,
Derived class destructor, Base class destructor
c. Derived class constructor, Base class constructor,
Base class destructor, Derived class destructor
d. Base class constructor, Derived class constructor,
Base class destructor, Derived class
destructor@studywithhamzA25
18. Following code is equivalent to which option.
class Shape
{
string type;
};
a. class Shape { public: string type; };
b. class Shape { protected: string type; };
c. class Shape public: { string type; };
d. class Shape { private: string type;
};@studywithhamzA25
19. "cin" is an object of ____ class.
a. istream@studywithhamzA25
b. fstream
.c. ostream
d. instream
20. Suppose c1, c2, and c3 are the objects of the
Complex class and we overloaded the + operator.
c3 = c1 + c2;
In this statement, ___________ object will be passed as
argument when + operator is called.
a. c1@studywithhamzA25
b. c2
c. c1 and c2
d. c3
21. "cout" is an object of ____ class.
a. ostream@studywithhamzA25
b. fstream
c. instream
d. istream
22. What is the access specifier used to specify that the
members of a base class are accessible in the derived
class but not to the outside world?
a. friend
b. protected@studywithhamzA25
c. private
d. public
23. Following code is equivalent to which option.
class Shape
{
string type;
};
a. class Shape public: { string type; };
b. class Shape { public: string type;
};@studywithhamzA25
c. class Shape { private: string type; };
d. class Shape { protected: string type; };
24. What is the purpose of new operator?
a. Allocates memory for an object or array and returns a
particular pointer@studywithhamzA25
b. Allocates memory for an object or array
c. Used as return type when an object is created
d. Used to declare any new thing in a program
25. Which of the following is true about the friend
functions?
a. Access specifiers has no impact on friend functions or
classes
b. All of the given options@studywithhamzA25
c. Prototypes of friend functions appear in the class
definition.
d. Friend functions can be placed anywhere in the class
26. A class can be inherited from another class in
__________ ways.
a.1
b.2
c.4
d.3@studywithhamzA25
27. In which order are constructors and destructors
called in a derived class inheriting from a base class?
a. Derived class constructor, Base class constructor,
Derived class destructor, Base class destructor
b. Base class constructor, Derived class constructor,
Derived class destructor, Base class
destructor@studywithhamzA25
c. Base class constructor, Derived class constructor,
Base class destructor, Derived class destructor
d. Derived class constructor, Base class constructor,
Base class destructor, Derived class destructor
28. Which of the following is correct symbol of stream
extraction operator?
a.>
b. <
c. >>@studywithhamzA25
d. <<
29. A doctor can see patients. This type of relationship
is known as ________.
a. Two-way Association
b. Binary Association
c. One-way Association@studywithhamzA25
d. Ternary Association
30. "cin" is an object of ____ class.
a. ostream
b. instream
c. istream@studywithhamzA25
d. fstream
SUBSCRIBE MY YOUTIBE
CHANNEL
SubSCRIBE NOW
THANK YOU!