Question: Multiplication Table Language: Java Using nested loops, create a multiplication table from 1 to 12. Your output should look like this: Look at the PowerTable.java

Multiplication Table

Language: Java

Using nested loops, create a multiplication table from 1 to 12. Your output should look like this:

Look at the PowerTable.java example in section 4.8 to see how to format a printf statement so that everything lines up night. Here is the printf statement that I used in the code above:

System.out.printf("%4d", row*col);

Essentially, you are reserving four spaces to hold the results of row*col. This will make your multiplication table look like the example.

Note: If you have more than 6 lines of code (not including brackets, the class declaration, and the main), then you have too much code. No additional methods needed. It can be simplified.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!