12345678910111213141516171819202122232425262728293031323334 |
-
- public class TableUtilities {
- public static String getSmallMultiplicationTable() {
- String str= "";
- for (int i=1; i<=5; i++){
- int product=0;
- for (int j=1; j<=5;j++){
- product= i*j;
- str += String.format("%3d |", product);
- }
- str+="\n";
- }
-
- return str;
- }
-
- public static String getLargeMultiplicationTable() {
- String str="";
- for(int i=1; i<=11; i++){
- int product=0;
- for (int j=1; j<=11; j++){
- product=i*j;
- str+= String.format("%10d |", product);
- }
- str+="\n";
- }
- return str;
- }
-
- public static String getMultiplicationTable(int tableSize) {
- return null;
- }
- }
|