/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Capitulo_4.Ecuacion_cuadratica;

/**
 *
 * @author calderon
 */
public class Complejo {
    private double Real;
    private double Imag;
    
    public Complejo(double unR, double unC) {
        Real = unR;
        Imag = unC;
    }
    
    @Override
    public String toString() {
        String aux;
        
        if(Imag > 0) 
            aux = Real + " + " + Imag + " j \n";
        else if (Imag ==0)
            aux = Real + "\n";            
        else 
            aux = Real + " - " + Imag*(-1.0) + " j \n";
        return aux;
    }
    
}
