Question: Write a class called MyComplex which models the complex numbers a + bi. It contains: 1) Two private double variables real and img. 2) A

Write a class called MyComplex which models the complex numbers a + bi. It contains: 1) Two private double variables real and img. 2) A default constructor to create a complex number at 0+0i. 3) A constructor which takes two double a and b and initializes this complex number to a+bi. 4) Setters and Getters(accessors and mutators) for private variables real and img. 5) tostring () that returns "a + bi" form of the complex number. If b is negative, we want the string to be "a - bi
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
