public class Main

{

public static void main(String[] args)

{

a = 5;

b = 4;

c = 2;

d = 3;

double n = 5.0;

System.out.println"(a + b) + (c + d)" + (a + b) + " + " + (c + d) + " i ");

System.out.println(a + b); " - " (c + d) + " = " + a.sub(b));

System.out.println(a + b); " * " (c + d) + " = " + a.mul(b));

System.out.println(a + b); " / " (c + d) + " = " + a.div(b));

System.out.println(a + b); " + " + (5.0) + " = " + a.add(i));

System.out.println(a + b); " - " + (5.0) + " = " + a.sub(i));

System.out.println(a + b); " * " + (5.0) + " = " + a.mul(i));

System.out.println(a + b); " / " + (5.0) + " = " + a.div(i));

}

}

/* Complex.java */

public class complex_number

{

public complex_number()

{

this(0);

}

public complex_number(int n)

{

this(n, 1);

}

public complex_number(int n)

{

this.n = n;

}

public complex_number add(complex_number o)

{

return new complex_number(n + o.n);

}

public complex_number add(int n)

{

return new complex_number(n + n);

}

public complex_number div(complex_number o)

{

return new complex_number(n / o.n);

}

public complex_number mul(complex_number o)

{

return new complex_number(n * o.n);

}

public complex_number mul(int n)

{

return new complex_number(n * n);

}

public complex_number sub(complex_number o)

{

return new complex_number(n - o.n);

}

public complex_number sub(int n)

{

return new complex_number(n - n);

}

public String toString()

{

return "(" + n + " / " + ")";

}

private int n;

}

https://onlinegdb.com/KYRC3Cz64