// Bob Myers // complex.h -- header for class Complex // // an object of type Complex represents a complex number in the form: // real + imag*i // // where 'real' is the real part and 'imag' is the imaginary part. 'i' is // the square root of -1. // // Try adding in operator overloads for + , - , * arithmetic operations // Try adding in an overload of the insertion operator << for output, // to print in the same format that the Show() function uses class Complex { public: Complex(); // default constructor, init to 0 Complex(int r, int im = 0); // init to r + im * i void Set(int r, int im); // mutator -- sets object data int GetReal() const; // return real part int GetImag() const; // return imaginary part void Show() const; // print imaginary number in the form // a + bi to standard output private: int real; // real part int imag; // imaginary part };