I need some help on a simple program that I can't get to work. Here is the code that I have so far:
Any help will be greatly appreciated.Code:class testClass { public: int sum(); //Postcondition: Returns the sum of the // private data numbers void print() const; //Prints the values of the private data //members testClass(); //defualt constructor //Postcondition: x =0; y =0 testClass(int a, int b); //constructor with parameters //Initializes the private data members to the //values specified by the parameters. //Postcondition: x = a; y= b private: int x; int y; }; #include <iostream> using namespace std; testClass::testClass() { x = 0; y = 0; } testClass::testClass(int a, int b) { x = a; y = b; } void testClass::print() const { cout << "The sum of " << x << " and " << y << " is " << sum() << endl; } int testClass::sum() { return (x + y); } // Main int main() { int a=0; int b=0; testClass t; testClass(); t.print(); cout << endl << "Input 2 integers: "; cin >> a >> b; testClass(a,b); cout << endl << t.sum() << endl; return 0; }