View Single Post
(#2 (permalink))
Old
Whatever is Offline
Private
Points: 193, Level: 2 Points: 193, Level: 2 Points: 193, Level: 2
Activity: 0% Activity: 0% Activity: 0%
Whatever is an unknown quantity at this point
 
 
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Dec 2007
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.