Question: Create the following functions a. A default Constructor that sets the complex number to 0 b. Constructor that takes a single double for the real
Create the following functions a. A default Constructor that sets the complex number to 0 b. Constructor that takes a single double for the real part of complex number and sets the Imaginary=0 c. Constructor that takes two doubles (real and imaginary parts of a complex number). d. getReal() - returns real part of complex number as a double. e. getImaginary() - returns imaginary part of number as a double. f. getMagnitude() - returns the magnitude of the polar form of the number g. getAngle() - returns the angle of the polar form of the number h. setReal() - sets the real part of the complex number i. setImaginary() - sets the imaginary part of the complex number j. setComplex() - sets both real and imaginary parts of a complex number k. Create individual multiplication, division, addition, and subtraction functions. They all take a myComplex object and return a myComplex object. l. Operators: +, -, *, / m. conjugate() function which returns the conjugate of the current object. n. Equality operators: == and !=. Two complex numbers are equivalent if their real/imaginary parts differ by at most 0.001. o. Overloaded << operator so Complex objects print like: (5.3 + 2.1i) p. Overloaded >> operator so you can enter a complex number from the keyboard.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
