@Test public void add() { NumarComplex nr=new NumarComplex("3+i"); nr.add(new NumarComplex("i")); assertEquals(new NumarComplex("3.0+2.0i"), nr); }
public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; }
NumarComplex { public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; } }
NumarComplex { public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; } NumarComplex();  NumarComplex(String nr); }
NumarComplex { public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; } NumarComplex();  NumarComplex(String nr); double getImg(); void setImg(double img); double getReal(); void setReal(double real); NumarComplex add(NumarComplex z); NumarComplex subtract(NumarComplex z); NumarComplex mul(NumarComplex z); NumarComplex div(NumarComplex z); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
NumarComplex { public NumarComplex add(NumarComplex z) { this.setReal(this.real + z.getReal()); this.setImg(this.img + z.getImg()); return this; } NumarComplex();  NumarComplex(String nr); double getImg(); void setImg(double img); double getReal(); void setReal(double real); NumarComplex add(NumarComplex z); NumarComplex subtract(NumarComplex z); NumarComplex mul(NumarComplex z); NumarComplex div(NumarComplex z); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }