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
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\).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
