Question: CSC 212 Project! Student Name Student ID: epp, Following is the source code projectl.cpp. Given the Complex class and myStack template class in project I

 CSC 212 Project! Student Name Student ID: epp, Following is the
source code projectl.cpp. Given the Complex class and myStack template class in

CSC 212 Project! Student Name Student ID: epp, Following is the source code projectl.cpp. Given the Complex class and myStack template class in project I complete the main fanction as required in the comments, and then compile, debug and test your program. l projectl.cpp Winclude ciostream> #include #include using namespace std; ll complex number class I real part // imagination part class Complex float re; float im; public: Complex(float r 0.0, float i-0.0) fre r; im-i:) Complex(const Complex&c)tre-c.re; im-c.im;) void operator (const Complex&c)fre c.re; im-c.im Complex operator-Oconst (return Complex(-re, im):) Complex operator +(const Complex&) const Complex operator -(const Complex&) const; Complex operator *(const Complex&) const; Complex operator (const Complex&) const; friend ostream&operator (ostream&, const Complex&) Il constructor // copy constructor l assignment // unary negation / addition operator II subtraction operator /l multiplication operator Il division operator Il output operator Complex Complex:operator +(const Complex& c) const W addition operator float r-re+c.re; float i-im+c.im; return Complex(r.i) Complex Complex:operator-(const Complex&c) const Il subtraction operator float r re-c.re; float i im-c.im; return Complex(r,i); Complex Complex::operator (const Complex&c) const I/ multiplication operator float r re c.re-im c.im; float i=re*c.im +1m * c.re; return Complex(r.); Complex Complex:operator /(const Complex&c) const /l division operator Complex nm -Complex"this) Complex(c.re, -c.im); float dn c.re c.re+c.im c.im; float r nm.re/ dn; float i-nm.im/ dn; return Complex(r.i)

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!