# create a multiplication table INVOKING

Page 1 of 1

## 2 Replies - 1104 Views - Last Post: 06 October 2013 - 04:58 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=330874&amp;s=da62a88d6e0d20ed3e5566413a949b51&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 michaelphongsak

Reputation: 0
• Posts: 1
• Joined: 06-October 13

# create a multiplication table INVOKING

Posted 06 October 2013 - 09:32 AM

I got most if this done and the program runs, but my professor said that I didn't complete it. I need to use a method which prints each row which is invoked from the method that printsthe overall multiplication table.

heres the assignment:
Multiplication Table
A set of nested for loops can be used to print a multiplication table using System.out.printf statements.

Write a program to print such a multiplication table, using a method to print each row, which is invoked from the method that prints the overall multiplication table.

my code:
```public class MultiplicationTable
{
public static void main (String[] args) {
System.out.print(" ");
for (int i = 1; i <= 9; i++)
System.out.println();
// print separator
System.out.print(" ");
for (int i = 1; i <= 9; i++)
System.out.print(" ");
System.out.println();
// print main table
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= 9; j++) {
}
System.out.println();
}
} // end of main

public static String pad(int x) {
String s = new String();
if (x < 10) s = " " + x;
else if (x < 100) s = " " + x;
else s = "" + x;
return s;
}
}

```

Is This A Good Question/Topic? 0

## Replies To: create a multiplication table INVOKING

### #2 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11789
• Posts: 44,297
• Joined: 27-December 08

## Re: create a multiplication table INVOKING

Posted 06 October 2013 - 03:27 PM

2) What have you tried? What specific problems or errors are you encountering?

### #3 pbl

• There is nothing you can't do with a JTable

Reputation: 8370
• Posts: 31,956
• Joined: 06-March 08

## Re: create a multiplication table INVOKING

Posted 06 October 2013 - 04:58 PM