Question: Write a class for complex numbers. A complex number has the form a + bi, where a and b are real numbers and i is
Write a class for complex numbers. A complex number has the form a + bi, where a and b are real numbers and i is the square root of -1. We refer to a as the real part and b as the imaginary part of the number. The class should have two instance variables to represent the real and imaginary numbers; the constructor takes two arguments to set these members. Discuss and implement other appropriate methods for this class.
Step by Step Solution
3.39 Rating (165 Votes )
There are 3 Steps involved in it
Code is as follows Complexjava public class Complex private final double a the real part private final double b the imaginary part create a new object ... View full answer
Get step-by-step solutions from verified subject matter experts
