Question: This is a java eclipse problem. -Make sure you submit 2 files - the .java file that defines the object - ComplexNumber.java the usage file

This is a java eclipse problem.

-Make sure you submit 2 files -

the .java file that defines the object - ComplexNumber.java

the usage file - ComplexNumberUsage.java(or something similar)

complex number has 2 parts: real number & imaginary number

addition of 2 complex numbers cn1, cn2

cn1's real part + cn2's real part

cn1's imaginary part + cn2's imaginary part

subtraction of 2 complex numbers cn1, cn2

cn1's real part - cn2's real part

cn1's imaginary part - cn2's imaginary part

multiplication of 2 complex numbers

( (cn1's real part cn2's real part) - (cn1's imaginary part cn2's imaginary part) ) +

( (cn1's real part cn2's imaginary part) + (cn1's imaginary part cn2's real part) )

2 complex numbers : (a+ib) & (c+id)

addition : ( (a+c) + i(b+d) )

subtraction : ( (a-c) + i(b-d) )

multiplication : ( (ac-bd) + i(ad+bc) )

1) ComplexNumber.java should have the following as a minimum :

-fields/properties for a complex number(i.e. 2 double numbers)

-constructor which takes in 2 double values as parameters & assigns them to the fields.

-add method

-subtract method

-multiply method

-toString method

2) ComplexNumberUsage.java should have ONLY the main method.

Inside the main, the following will be needed to accomplish our goal :

-declare 2 ComplexNumber objects

-get 4 double values from user (because we need 2 values to create a complex number - first 2 double numbers form the first complex number & the second 2 double numbers form the second complex number)

-create the 2 complex numbers by using the values got from user.

-Use the methods (add, subtract, multiply) & display the result

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!