package ClassesIntro;

public class ComplexNumberTest {

    public static void main(String[] args) {
        if (args.length > 0) {
            String a1 = args[0];
            String a2 = args[1];

            ComplexNumber c3 = new ComplexNumber(Double.parseDouble(a1), Double.parseDouble(a2));
            System.out.println("C3: " + c3);
        }

        ComplexNumber c1 = new ComplexNumber(2.4, 3.7);
        ComplexNumber c2 = new ComplexNumber(1.3, 3.1);

        ComplexNumber product = c1.multiply(c2);
        System.out.println("Product: " + product);

        /* Change the real part of c1 and the imaginary part of c2 */
        c1.setReal(-3);
        c2.setImaginary(-2.1);

        // Print just the real component
        System.out.println(c1.getReal());
        System.out.println(c2.getReal());

        // Print the whole complex number
        System.out.println(c1);
        System.out.println(c2);

        // Print the produt of the altered complex numbers.
        System.out.println("The product of " + c1 + " and " + c2 + " is " + c1.multiply(c2));
    }
}