Modify the toString() method in Comp1ex (Program 3.2.6) so that it prints complex numbers in the traditional

Question:

Modify the toString() method in Comp1ex (Program 3.2.6) so that it prints complex numbers in the traditional format. For example, it should print the value \(3-i\) as \(3-i\) instead of \(3.0+-1.0 i\), the value 3 as 3 instead of \(3.0+0.0 i\), and the value \(3 i\) as \(3 i\) instead of \(0.0+3.0 i\).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: