If I were you I would simply create another moduel to your program that converts your private variables and work into strings for output. Or you could just do something along the lines of this:
this would output the answer and you could put a line above it that explains what you told the program to do to the varibles it took into the bufferCode:real = rr; imaginary = ii; public double magnitude() { // return the sq root of Complex number return Math.sqrt(r*r + i*i);
so for example you could have something like this above :
you could devise a much more complicated system for this where when you told three calc to do something it would append that process to the output line of the line....but then you would have to add a string variable that made sense to each type of calculation that you would want your calc to be able to preformCode:real = rr; imaginary = ii; public double magnitude() { // return the sq root of Complex number system.out.println( "i told this hunk of crap to make the sqrt of a complex number using the Math.sqrt(real*real + imaginary*imaginary) function" ); return Math.sqrt(r*r + i*i);
http://www.antionline.com/showthread...hreadid=273394 (an example of a calc i did for complex numbers)




Reply With Quote