Question: This needs to be done with java. A.Create a Complex number class. A complex numbers has two parts referred to as the real part and

This needs to be done with java.

A.Create a Complex number class. A complex numbers has two parts referred to as the real part and the imaginary part. To add two complex numbers sum the real parts and the imaginary parts. For example if xs real part is 2.0 and its imaginary part is 5.0 and ys real part is 3.0 and its imaginary part is 4.0 the sum of x and y would have a real part of 2.0 + 3.0 and an imaginary part of 5.0 + 4.0.

The UML for the class is shown below. Verify that the class is functional.

Complex

-real: double

-imag: double

+Complex()

+Complex(r:double, i:double)

+toString():String

+add(secnd:Complex):Complex

B. Create a Frame similar to the one shown below. A user can enter values for two complex numbers. Radio buttons select which number, x or y is being set. The numbers Real and Imaginary component is entered in the appropriate Textfield. The Frame displays each number or the sum of the two numbers based on which show button is clicked.

This needs to be done with java. A.Create a Complex number class.

Thank you

Complex Number Frame Two complex numbers are available: x, y Real 2.0 Imag 3.5 Oy Enter Show x Show y Show x y

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!