logo Practice-It logo

BJP3 Self-Check 7.36: jaggedArray

Language/Type: Java 2D arrays
Author: Marty Stepp (on 2013/09/02)

Write a piece of code that constructs a jagged two-dimensional array of integers named jagged with five rows and an increasing number of columns in each row, such that the first row has one column, the second row has two, the third has three, and so on. The array elements should have increasing values in top-to-bottom, left-to-right order (also called row-major order). In other words, the array's contents should be the following:

2, 3
4, 5, 6
7, 8, 9, 10
11, 12, 13, 14, 15
Type your solution here:

This problem asks for bare code. Submit a fragment of Java code as described. Do not write any class or method heading around your code; just write the lines of code that will produce the result described.

You must log in before you can solve this problem.

Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.