#ifndef COMPLEX_CPP #define COMPLEX_CPP #include "ComplexNumber.h" #include Complex::Complex(double real, double imaginary) { this->real = real; this->imaginary = imaginary; } double Complex::getReal() const { return real; } double Complex::getImaginary() const { return imaginary; } Complex Complex::operator+(const Complex& other) const { double resultReal = real + other.real; double resultImaginary = imaginary + other.imaginary; return Complex(resultReal, resultImaginary); } std::ostream& operator<<(std::ostream& os, const Complex& complex) { os << complex.getReal() << "+" << complex.getImaginary() << "i"; return os; } #endif