RHS =>  Allan =>  Basic Programming => Exercises => LittleTable Updated:  02/02/2004 23:36
WebMaster: allanhn@rhs.dk

Little Table

Question 1
You are to create a method littleTable() in a class named Table, which can print out the little table in the following form:

1 * 1 = 1
1 * 2 = 2
...
1 * 10 = 10

2 * 1 = 2
2 * 2 = 4
...
2 * 10 = 20

....
10 * 1 = 10
10 * 2 = 20
...
10 * 10 = 100

Before programming discuss carefully in your study group how the problem is to be solved with a counter-loop inside a counter-loop.
Then write a program with the method in a class Table and an application class TableApp.

Question 2
You are to create a method bigTable(), which can print out the big table (i.e. use numbers 1-20).

Question 3  Optional
Extend the class with a method
generalTable (int start, int stop) which can print out any part of the big table controlled by the start and stop parameters.