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

J Consider the following declarations: class xClass { public: void func(); void print() const; xClass ); xClass (int, double); private: int u; double w; }; a. Write the definition of the member function func so that u is set to 10 and w is set to 15.3. b. Write the definition of the member function print that prints the contents of u and w. c. Write the definition of the default constructor of the class xClass so that the private member variables are initialized to 0. d. Write a C++ statement that prints the values of the member variables of the object X. e. Write a C++ statement that declares an object t of type xClass and initializes the member variables of t to 20 and 35.0, respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
