go back to the complex numbers code in figures 50


Go back to the complex numbers code in Figures 50 and 51 of your notes. Add code fragments to handle the following:

1. A function for adding two complex numbers given in algebraic form (i.e., in the form x + iy)

2. The possibility of representing complex numbers in phasor form (i.e., in the form z(cos(θ) + isin(θ), where z = √x2+y2 and θ = y/x). The corresponding structure should have two fields: one for z and the other for θ.

3. A function to convert a complex number in algebraic form to a complex number in phasor form

4. A function to convert a complex number in phasor form to a complex number in algebraic form

5. Write a client program to test your code. The client program should do the following:

a. request the x and y values of two complex numbers in algebraic form ((2 + i4) and (2 + i2)). The program should then:

b. add the two complex numbers and display the numbers and their sum in both algebraic and phasor forms

c. multiply the two complex numbers and display the numbers and their product in both algebraic and phasor forms

in (b) and (c) above, pass the sum and product respectively to the function you wrote in (4) above and display the corresponding complex numbers in algebraic form

Request for Solution File

Ask an Expert for Answer!!
Mathematics: go back to the complex numbers code in figures 50
Reference No:- TGS0414349

Expected delivery within 24 Hours