In this PHW, you will practice working with two-dimensional arrays.
MultiplicationTable
with 2 fields: a two-dimensional integer array & a scaling factorarray[0][0] = scaling factor
array[w-1][h-1] = scaling factor * width * height
print
method to print out the tablelookup
method that takes two indexes (of the ranges 1 to width and 1 to height) and returns the appropriate value (or 0 otherwise)Optional: Want all your numbers to line up in nice columns?
String format = "%10d"; // padd number to take 10 spaces total
int value = 1250;
System.out.format(format, value);
Optional: Want all your numbers to line up relative to the length of the largest value? Figure out the length of your longest number:
String.valueOf(biggest).length();
Coming soon…