Given the following class definition and the following member function header, which is the correct way to output the private data? class Pe

class Person
{
public:
void outputPerson(ostream& out);
private:
int age;
float weight;
int id;
};

void Person::outputPerson(ostream& out)
{
//what goes here?
}
a. out << person.age << person.weight << person.id;
b. out << person;
c. out << age << weight << id;
d. outputPerson(person);


c. out << age << weight << id;

Computer Science & Information Technology

You might also like to view...

Data items whose values do not change while the program is running are

a. literals b. variables c. characters d. integers e. None of these

Computer Science & Information Technology

A solution with exponential complexity is ____________________ .

a) efficient b) inefficient c) easy to implement d) difficult to implement e) none of the above

Computer Science & Information Technology

Here are several function members of a class. Tell whether each may be used as an l-value, only, an r-value only or both. B is a class that has mutators.

a. //declarations of these appear together in the //definition of class A int& A::f( ){ /* */} const int& A::f( )const{ /* */} b. const int& A::f( ){ /* */} c. const B A::f( ){ /* */} d. B A::f( ){ /* */}

Computer Science & Information Technology

Which of the following are implemented to ensure that an organization can control mobile device settings, applications, and other parameters when they are attached to the enterprise? (Choose two.)

A. APT B. CERT C. MDM D. MAM

Computer Science & Information Technology