Question: 5. Consider the following declarations: class xClass { public: void func(); void print() const; xClass (); xClass (int, double); private: int u; double w; };

5. Consider the following declarations:

class xClass

{

public:

void func();

void print() const;

xClass ();

xClass (int, double);

private:

int u;

double w;

};

xClass x;

a. How many members does class xClass have?

b. How many private members does class xClass have?

c. How many constructors does class xClass have?

d. Write the definition of the member function func so that u is set to 10 and w is set to 15.3.

e. Write the definition of the member function print that prints the contents of u and w

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!