Question: 6. Let a - ib be a complex number. The conjugate of a + ib is a - ib and the absolute value of a
6. Let a - ib be a complex number. The conjugate of a + ib is a - ib and the absolute value of a + ib is . Suppose you have a class complexType (as in the Programming Example: Complex Numbers):
class complexType
{
public:
.
.
.
private:
double realPart;
double imanginaryPart;
};
Extend the definition of class complexTye by overloading the operators ~ and ! as member functions so that ~ returns the conjugate of a complex number and ! returns the absolute value. Also write the definitions of these operator functions. Redo so that the operators ~ and ! are overloaded as nonmember functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
