Question: P6.1 The interface for the Complex class is provided below (Note that the first letter of Complex is capitalized in order to distinguish it from

 P6.1 The interface for the Complex class is provided below (Notethat the first letter of Complex is capitalized in order to distinguish

P6.1 The interface for the Complex class is provided below (Note that the first letter of Complex is capitalized in order to distinguish it from the complex class define in header file). A complex number c is defined as c a bi where c is the complex number consisting of two part: real part denoted by 'a' and an imaginary part denoted by 'b' multiplied by and i- V-1. The website at https en.wikipedia o number provides an introductory level discussion of complex numbers.) Operations such as addition, subtraction, multiplication, and division can be performed on complex number in a way similar to the operations performed on rational numbers since computations only involve a and b, which are real numbers. For you convenience, the basic four operations or computations are provided below. Note that all four computations involve only real numbers (double type in C++), this program is very similar to the rational number problem (a bi) (c di) (a c) (b d) Addition: (a +bi) (c di) c) (b- d) Subtraction: (a bi)(c di) ac bd) (bc ad) Multiplication: a bi c di Division: where i 1 it does not even enter into your program code. class Complex friend operator out const Complex & friend istceanu& operator cistceau & out, Complex &Seti) prompt message "Enter real and imaginary values is displayed in main by the client of the class Postcawadition: two values entered by the users are assinged to real and inaag of coki, respectively public: Complex default constructor Complex double r, double Postcondition: a complex object is declared and initialized to (r, D or (0, 0) if no values are passed to the constructor void set camplexNumber (double a, double b) a mutator function Postcondition: set the real and imaginary parts of the calling complex object to a and b, respectively Complex operator+(const Complex &c2) const; Postcondition: sum of this) -c2 is returned. Complex operator-(const Complex c2) const Postcondition: difference of this) c2 is returned Complex operator (const Complex &c2) const; Postcondition: product of this) c2 s returned Complex operator const Complex &c2) const

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!