Commit e8318647 authored by quinn.haigh's avatar quinn.haigh

final

parent 3608fa81
public class Complex
{
// set values for numbers
double real;
double imag;
......@@ -12,6 +12,7 @@ public class Complex
imag = 0;
}
//initiate numbers
public Complex(double _real, double _imag)
{
......@@ -20,6 +21,7 @@ public class Complex
}
//return values
public double real()
{
......@@ -32,7 +34,9 @@ public class Complex
return imag;
}
//method to work out magnitude of the numbers
public double magnitude()
{
double answerA = Math.pow(real, 2);
......@@ -46,7 +50,7 @@ public class Complex
}
//method for returning the arguement
public double argument()
{
......@@ -55,7 +59,7 @@ public class Complex
return arg;
}
//method to add complex numbers together
public Complex add(Complex b)
{
Complex a = this;
......@@ -67,6 +71,7 @@ public class Complex
}
//printing complex numbers to a string output
public String toString()
{
if(real == 0.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment