0
Can you help me with this ?
Define a class Complex to manipulate complex numbers. This class will contain: — 2 private variables of type double for the real part and the imaginary part of the complex number — a constructor having 2 parameters of type double — a constructor having one parameter of type Complex — a method to compute the absolu te value of a complex number (meaning the square root of re*re+im*im, where re= the real part and im = the imaginary part) — overwrite the method toString to print real_part+i*imaginary_part
3 Antworten
0
Is this your home work or What?
0
you can say that :)
0
class Complex{
private double Real;
private double Imaginary;
public Complex(double a, double b){};
public Complex(Complex a){};
public double ComputeAbsoluteValue{};
}
now you have to fill constructors, ComputeAbsoluteValue and overwtite toString method.