public class TimesTable
extends java.lang.Object
The provided code is incomplete. Modify it so that it works properly and passes the tests in
TimesTableTest.java
.
Constructor | Description |
---|---|
TimesTable() |
Modifier and Type | Method | Description |
---|---|---|
static int[][] |
createTimesTable(int first,
int second) |
Given two positive numbers first and second, produce a multiplication table
for numbers first through second, inclusive.
|
static void |
main(java.lang.String[] unused) |
Solicits two integers from the user and print the resulting multiplication table.
|
public static int[][] createTimesTable(int first, int second)
For example, if create(4, 6) produces the following 2D array: [[0, 4, 5, 6] [4, 16, 20, 24] [5, 20, 25, 30] [6, 24, 30, 36]]
Note that:
You should reject any values of first and second that are not positive. You should also reject the case where second is not greater than first. In these cases create return null.
first
- the number to start the multiplication table atsecond
- the number to end the multiplication table atpublic static void main(java.lang.String[] unused)
You are free to review this function, but should not modify it. Note that this function is not tested by the test suite, as it is purely to aid your own interactive testing.
unused
- unused input arguments