1. Engineering
  2. Computer Science
  3. the c complex class in this assignment you are to...

Question: the c complex class in this assignment you are to...

Question details

The C++ complex class. In this assignment you are to implement a class for complex numbers. Below is the interface for the class class complex friend complex operator+(float,const complex&); friend complex operator-(float,const complex&); friend complex operator*(float,const complex&); friend complex operator/(float,const complex&); triend ostrean & operator<c (ostreank outtile,const complexk) ; public: static const complex i; complexO; complex(float,float); const complex & operator-(const complex&); const complex & operator-(float); bool operator-(const complexk) const; complex operator+(const complexk) const; complex operator+(float) const; complex operator-(const complex&) const; complex operator-(float) const; complex operator-) const; complex operator* (const complex&) const; complex operator*(float) const complex operator/(const complex) const; complex operator/(float) const; private: float ipart; float rpart; J; Results. After you have implemented the class write a short program which calcu- lates (4z2-2x - 1)/(i +1) for (1+2i)/2. Both the polynomial and the x-value may be hard-coded into main.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution