/* ** Name: complex.h ** Author: Leo Liberti ** Purpose: header file for a complex numbers class ** Source: GNU C++ ** History: 061019 work started 120124 revision - presented to X09 students */ #ifndef _COMPLEXH #define _COMPLEXH #include #include class Complex { public: Complex(); Complex(double re, double im); ~Complex(); double getReal(void); double getImaginary(void); void setReal(double re); void setImaginary(double im); void fromString(const std::string& complexString); Complex operator+(Complex& theComplex); Complex operator-(Complex& theComplex); Complex operator*(Complex& theComplex); Complex operator/(Complex& theComplex); private: double real; double imag; }; std::ostream& operator<<(std::ostream& out, Complex& theComplex); #endif