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
Get step-by-step solutions from verified subject matter experts
