 Let's write a program that creates the multiplication table for the digits 1 through 9. There are 9 rows, a good candidate for a loop. And each row has 9 columns, also a good candidate for a loop. Each entering the table is the product of the row number and the column number. To get this result, we'll need nested loops, 4 loops inside of 4 loops. It's really important to plan your output before you start writing your code. Let's look at what the header lines are going to look like. I'm going to have 2 dashes and a plus sign. And then in the rows beneath it, I'll have the number, a space, and a vertical bar. And let's just do the first 4 rows to get an idea of the process. Here in the main table, let's give 4 spaces per number. And then in the second row, we'll have 2, 4, 6, 3, 6, 9. And in the fourth row, 4 times 1 is 4, 4 times 2 is 8. And we want things so that the right-hand side of the numbers lines up. But notice there's still 4 spaces for each of the numbers. That means that our header row will have to have 4 dashes for each number. And the heading line above it will also have to have the same spacing. And we'll need 3 spaces at the beginning to line everything up properly. I've put it here in the comments where each dot represents a blank space. Let's start with the 2 header lines. While I could do something like this, system.out.println, and then count the spaces myself by hand, that's a lot of work and is very error-prone. Instead, let's use 4 loops to have Java do the counting for us. The first line of the header starts with 3 spaces and then the numbers 1 to 9. We'll use a loop that starts at 1, less than 10, adding 1 each time. And then use formatted printing with 4 spaces for an integer, whatever that number is. And that's the end of the first line of the header. For the second line of the header, we'll print dash dash plus, and then have another loop that counts from 1 to 9. And this time, we'll print 4 dashes. And that's the end of the second header line. Let's save that program, compile it, and run it just to see that this part works. I like to test my programs one stage at a time rather than writing the entire program and then testing it. And so far, it's looking good. Now let's get to the body of the table. We see that there are 3 characters up to and including the vertical bar. And then each of the number takes up 4 spaces. Let's put a comment, and in fact, we may as well put a comment here. And we'll write the outer 4 loop that prints the row numbers. We'll start row at 1, and as long as row is less than 10, we'll do the body of the loop and then add 1 to row. We'll print the row plus a blank and a vertical bar, and later on, we'll print the column entries for the row, and then go to the next line. Let's test that, and that also is looking good. To print the column entries for the row, we need a 4 loop nested inside the outer loop. We're going to use the name column for our loop control variable. It also starts at 1, and the loop continues as long as it's less than 10, adding 1 each time through our inner loop, where we will use system.out.printf to give a formatted print 4 spaces as an integer, the row times the column, which is the entry for that particular row and column. Let's move this up a little bit to give ourselves more space. Clear it out, compile again, and run. And there's our multiplication table. Again, here's the nested loop part of the code with colors and lines to help you see their relationship. In regard to programming style, using meaningful variable names for your loop control variables and indenting correctly are vital for keeping your code organized and readable when you have loops inside of loops.