Question: C++ Programming Question Design a class that represents complex numbers called ComplexNumber. Complex numbers have both real and imaginary parts and are rectangular in shape,

C++ Programming Question

Design a class that represents complex numbers called ComplexNumber.

Complex numbers have both real and imaginary parts and are rectangular in shape, expressed as Complex Number = Real Part + jVirtual Part.

Whether 1: We should be able to do the following operations with two objects belonging to the ComplexNumber class.

complex_result = complex1+complex2;

complex_result = complex1-complex2;

complex_result = complex1*complex2;

complex_result = complex1/complex2;

Whether 2: We should be able to calculate the polar form of the ComplexNumber object with the convertToPolarForm() membership function. In polar form, there is amplitude (r) and phase () information of this complex number.

C++ Programming Question Design a class that represents complex numbers called ComplexNumber.

Whether 3: There is a display() membership function that prints information about the object of the ComplexNumber class. This function should print both the polar representation and the rectangular representation of the object belonging to the ComplexNumber class.

In header and cpp format.

Im z = x + iy RE X

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!