Question: modify the class Complex to allow setting a complex number specified in modulus-argument form. This means that the complex number can be set by specifying

modify the class Complex to allow
setting a complex number specified in modulus-argument form. This means that the complex
number can be set by specifying the magnitude (modulus) of the complex number and the angle
(argument) which it makes relative to the x-axis. Hint: Create a function called
setModulusArgument which takes in the modulus and argument (argument should be in
radians) and then convert to a Cartesian complex (z=x+iy) format. Also create a new show
function which shows the complex number in modulus argument format (hint, create a function
called showModulusArgument). Modify and run the main program shown on Page 27 setting
z = 5 + 10i as an input and then output the result in modulus-argument format. Also run the
program using r=10 and =/3 and input and printing the Cartesian version of z. Setting the
inputs and writing the outputs can all be done by modifying main.
 modify the class Complex to allow setting a complex number specified
in modulus-argument form. This means that the complex number can be set
by specifying the magnitude (modulus) of the complex number and the angle

using namespace std? class complex I public: Complex () : // Constructor Complex( double x, double x ) I// Orerloaded Cemplex ( ) ; / Destruetor void set (double X, double Y ) : void sum (Complex z) i void show (), private 1 double wi // read part double yi /l imaginary part i 1 Complext fComplex ( ) I x=0,7y=0,2 ) Corplext:Complex (double X, double Y ) l x=xjy=yj Arter aum : z1=3.5+5.31

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!