• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 52 pages
Exam (elaborations)

C++ Final.

Document preview thumbnail
Preview 4 out of 52 pages

Exam of 52 pages for the course Cs2 at Cs2 (C++ Final)

Content preview

C++ Final GRADE A QUESTIONS WITH ANSWER
Which of the following is true about inheritance?
Select one:

a.

All public member functions of the base class become the public member functions of
the derived class.

b.

All public member variables of the base class become the public member variables of
the derived class.

c.

The public member variables of the base class become the public or private member
variables of the derived class.

d.

All public members of the base class become the public members of the derived class. -
(correct answer)The public member variables of the base class become the public or
private member variables of the derived class.



Suppose that bClass is a class. Which of the following statements correctly derives the
class dClass from bClass?

Select one:

a.
class dClass:: protected bClass

{

//classMembersList

};

b.

class dClass: private bClass

{

//classMembersList

,};

c.

class bClass: public dClass

{

//classMembersList

};

d.

class dClass:: public bClass
{

//classMembersList

}; - (correct answer)class dClass: private bClass

{

//classMembersList

};



A call to the base class's constructor is specified in the heading of the definition of a
derived class constructor.

Select one:

True

False - (correct answer)True


The ____ members of an object form its internal state.

Select one:
a.static

b.protected

c.private

d.public - (correct answer)private

,Inheritance is an example of a(n) ____ relationship.

Select one:

a.has-a

b.handshaking

c.is-a

d.had-a - (correct answer)is-a


The private members of a base class can be directly accessed by a derived class.

Select one:

True

False - (correct answer)False



To ____ a public member function of a base class in the derived class, the
corresponding function in the derived class must have the same name, number, and
types of parameters.

Select one:

a.

rename

b.
redefine

c.

reuse
d.

overload - (correct answer)redefine



____ is the ability to use the same expression to denote different operations.
Select one:

, a.

Inheritance

b.

Encapsulation

c.

Composition

d.

Polymorphism - (correct answer)polymorphism


If the corresponding functions in the base class and the derived class have the same
name but different sets of parameters, then this function is ____ in the derived class.

Select one:

a.

overloaded

b.

reused

c.

redefined

d.

overridden - (correct answer)overloaded


If the derived class does not override a public member function of the base class, you
may specify a call to that public member function by using the name of the function and
the appropriate parameter list.

Select one:

True

False - (correct answer)True

Document information

Uploaded on
October 26, 2024
Number of pages
52
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
douglasmugwe82
5.0
(1)
Sold
2
Followers
0
Items
4215
Last sold
1 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions