Chapter 12: Problem 5
Consider the definition of the following class: class testClass { public: int sum(); //Returns the sum of the private member variables void print() const; //Prints the values of the private member variables testClass(); //Default constructor //Initializes the private member variables to 0 testClass(int a, int b); //Constructors with parameters //initializes the private member variables to the values //specified by the parameters //Postcondition: x = a; y = b; private: int x; int y; }; a. Write the definitions of the member functions as described in the definition of the class testClass. b. Write a test program to test the various operations of the class testClass.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.