/* Lesley Hogan * July 25th 2003 * MultiplyTable.java * Multiplication tables */ package net.bunnie.dos; import javax.swing.*; import net.bunnie.*; public class MultiplyTable { public static void main (String[] args) { int lower; int upper; int totalTimes; int spaces = 5; KeyboardReader r = new KeyboardReader(); System.out.print("Lower and upper boundries must be no more than 14 apart.\nEnter lower boundry of table: "); lower = r.readInt(); System.out.print("Enter upper boundry of table: "); upper = r.readInt(); System.out.println(); System.out.print(Format.justify('l', " ", spaces)); //System.out.print("\t"); for (int i = lower; i <= upper; i++) { System.out.print(Format.justify('l', i, spaces)); //System.out.print(i + "\t"); } System.out.println(); for (int x = lower; x <= upper; x++) { System.out.print(Format.justify('l', x, spaces)); //System.out.print(x + "\t"); for (int i = x * lower; i <= x * upper; i += x) { System.out.print(Format.justify('l', i, spaces)); /*System.out.print(i); if (i < x * upper) { System.out.print("\t"); }*/ } System.out.println(); } } }