|
December 13th, 2007
You could just have one loop for each operation, like so:
// print one line with Square Roots
System.out.print ("Square Root") ;
for (int i = s; i <= e; i++)
{
System.out.print (form.format (Math.sqrt(s)));
}
System.out.print("\n");
// Print one line with Cube Roots
System.out.print ("Cube Root");
for (int i = s; i < e; i++)
System.out.print... and so forth
It isn't very pretty, but it gets the job done. Mind you, form.format isn't standard Java, and I have no idea how it works, I just copied it from your code.
|