Question: CSC421 Assignment 1 (50 Points) Read the following program carefully and overload the operators +,- ./, and the friend ostream operator of the Complex class

 CSC421 Assignment 1 (50 Points) Read the following program carefully and

CSC421 Assignment 1 (50 Points) Read the following program carefully and overload the operators +,- ./, and the friend ostream operator of the Complex class as discussed in the course. Compile, debug and test the program using the following command lines: C++ -o myComplex myComplex.cpp enter> ./my Complex Center> // Student Name // Student ID // myComplex.cpp BLIN #include #include #include using namespace std; HAT class Complex float re: float im; W complex number class // real part W imagination part public: Complex(float -0.0,float i=0.0){re=r; im=;) // constructor Complex(const Complex& c){rec.re; im=c.im;} W copy constructor void operator (const Complex& 0){rc-c.re; im=c.im;} // assignment Complex operator -)const return Complex(-re, -im);} #unary negation Complex operator +(const Complex& ) const; # addition operator Complex operator (const Complex&) const; W subtraction operator Complex operator (const Complex&) const; // multiplication operator Complex operator (const Complex& ) const; // division operator friend ostream& operator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!