Hey all i am having some problems with an assignment of mine. This is the code it reffences to:
The questions are:Code:class xClass { public: void func(); void print() const; xClass (); xClass (int, double); private: int u; double w; {;
So far this is what i have for the answers-but im not quite sure i am correct.1) Write the definition of the member function func so that u is set to 10 and w is set to 15.3.
2) Write the definition of the member function print that prints the contents of u and w.
3) Write the definition of the default constructor of the class xClass so the private member variables are initialized to 0.
So, how do my answers look? Am i wayyyy off?Code:1) void xClass::func() { xClass exmpD; exmpD.u = 10; exmpD.w = 15.3; } 2) void xClass::print() const { cout << u << " " << w << end1; } 3) public: set2Zero() { u = 0; w = 0; }
David