Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Completion Fill in the blanks from the implementation of a Dog class: class Dog

ID: 3934412 • Letter: C

Question

Completion

Fill in the blanks from the implementation of a Dog class:

class Dog {

________________________________

void setName( string name );

void setOwner( string owner );

void setIsFriendly( bool isFriendly );

string getName() const;

string getOwner() const;

bool getIsFriendly() const;

________________________________

string m_name; // dog's name

string m_owner; // owner's name

_______________m_isFriendly; // true if friendly

};

In my main function, I create a Dog object named jessie and use the "set"

methods to initialize jessie's variables. Complete the following code to print

jessie's name and, if she is friendly, print the message "You can pet me!":

cout << _____________________________ << endl;

if ( ______________________________ )

cout << "You can pet me!" << endl;

Explanation / Answer

Answer:

_____bool__________m_isFriendly; // true if friendly

cout << ____________jessie.getName()_________________ << endl;

if ( _____________jessie.getIsFriendly()_________________ )

cout << "You can pet me!" << endl;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote