title: Adding and subtract complex numbers using OOP structure
body: <p>I have here a code that should print the sum and difference of two complex numbers. The instructions given are:<br>
  make the methods <code>add</code>, <code>subtract</code>, and <code>print</code> to be <code>void</code> and <br>
  test using the constructor's object.
  <br><br></p>
  
  <pre><code>public class Complex {
  
      /**
       * @param args
       */
      public double real;
      public double imag;
      public String output = "";
  
      public Complex(double real, double imag){
          this.real += real;
          this.imag += imag;
      }
  
      public Complex(){
          real = 0;
          imag = 0;
      }
  
      public double getReal(){
          return real;
      }
  
      public void setReal(double real){
          this.real = real;
      }
  
      public double getImag(){
          return imag;
      }
  
      public void setImag(double imag){
          this.imag = imag;
      }
  
      public void add(Complex num){
          this.real = real + num.real;
          this.imag = imag + num.imag;
      }
  
      public void subtract(Complex num){
          this.real = real - num.real;
          this.imag = imag - num.imag;
      }
  
      public void print(){
          //
      }
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          Complex c1 = new Complex(4.0, 8.5);
          Complex c2 = new Complex(8.0, 4.5);
  
          c1.add(c2);
          c1.subtract(c2);
          c1.print(); //expected answer 12.0 + 13.0i
                                      //-4.0 - 4.0i
      }
  
  }
  </code></pre>
  
  <p><br><br>
  The expected answers are 12.0 + 13.0i and -4.0 - 4.0i. Please help me with the method <code>print</code>. Thank you.</p>