logo CodeStepByStep logo

numberLoops4constant

The following program uses nested for loops to produce the following output:

....1
...2.
..3..
.4...
5....

Modify the program to use a single integer constant named SIZE that influences how many lines should be drawn. For example, if the SIZE is changed to 7, the output should become the following:

......1
.....2.
....3..
...4...
..5....
.6.....
7......
Class: Write a complete Java class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.