Question: Lets define a class to represent a complex number. A complex number is a number that consists of a real part and an imaginary part.
Lets define a class to represent a complex number. A complex number is a number that consists of a real part and an imaginary part. For instance, the complex number 4 + 5.5i, has a real part of 4 and a complex part of 5.5. Include in your class a constructor to set these two parts of a complex number accordingly. Also create a print method to print out the complex number (with the i).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
