Created
January 13, 2010 01:44
-
-
Save johnhmj/275842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class CComplex { | |
public double real; | |
public double imaginary; | |
private PrintStream jout = new PrintStream(System.out); | |
CComplex() | |
{ | |
this.real = 0; | |
this.imaginary = 0; | |
} | |
public void Print() | |
{ | |
this.jout.printf(" %.2f", this.real); | |
if ( this.imaginary == 0 ) | |
{ | |
return; | |
} | |
this.jout.printf(" + %.2f * i", this.imaginary); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment