View Single Post
Old 01-07-2005, 01:59 AM   PM User | #3
finittz
New to the CF scene

 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
finittz is an unknown quantity at this point
ok now that i've gotten that solved heres my renewed program...except now the problem is with alignment of the numbers...i need them to be centerly aligned, any ideas?

// The "Review" class.
import java.awt.*;
import hsa.Console;

public class Review
{
static Console c; // The output console

public static void main (String[] args)
{
c = new Console ();

int a, b;
c.print ("a/row:");
a = c.readInt ();
c.print ("b/col:");
b = c.readInt ();

a++;
b++;
int table[] [] = new int [a] [b]; // max for table

for (int row = 1 ; row < a ; row++) //length of rows
{
for (int col = 1 ; col < b ; col++) //length of columns
{
table [row] [col] = row * col;
c.print (table [row] [col] + " ");

}
c.println ();
}


} // main method
} // Review class
finittz is offline   Reply With Quote