Okay heres the project.....

Objective: Implement a ComplexNumber class to represent complex numbers (z = a + bi) and a ComplexNumberDriver class to test the former class.

1)

Instance variables:

private double real; /* real part */

private double imag; /* imaginary part */

2)

Constructor: Overload the constructor by providing 3 different versions of it:

public ComplexNumber ( double real, double imag )

{ /* regular constructor */ }

public ComplexNumber ( double real )

{ /* initialize the imag part to 0.0 */ }

public ComplexNumber ( ComplexNumber num )

{ /* duplicate NUM */ }

3)

Get/Set functions:

public double getReal ( )

{ /* returns the real part */ }

public double getImag ( )

{ /* returns the imaginary part */ }

public void setReal ( double realVal )

{ /* sets real to realVal */ }

public void setImag ( double imagVal )

{ /* sets imag to imagVal */ }

4)

Other non-static functions:

public double calcAbs ( )

{ /* returns the absolute value of this object */ }

public void add ( ComplexNumber num )

{ /* add NUM to this object */ }

public void sub ( ComplexNumber num )

{ /* subtract NUM from this object */ }

public void mult ( ComplexNumber num )

{ /* multiply NUM with this object */ }

public void div ( ComplexNumber num )

{ /* divide this object by NUM */ }

public String toString ( )

{

/* print this object */

/* if real = 3.0 and imag = -4.0, then you should return “3.0 – 4.0i” */

}

5)

Comparable interface:

public int compareTo ( Object num )

{

// compare this object to NUM based on its absolute value

}

How do do the adding,subtracting,mult,div...with void? Ive seen other ways to do it but it wasn't with void