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;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.