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

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!