about | help | code help+videos | done | prefs |
consecutive
Write a method named consecutive that returns a string representation of a two-dimensional array of int. The first parameter is the number of rows, and the second parameter is the number of columns. The elements start at one, increase in the row and then continue increasing in the next rows. For example, consecutive(2,3) should return {{1,2,3},{4,5,6}}. Build the array in this method, then use toString() to return the array as a string. You must cut and paste method toString() from the Hint. consecutive(2, 3) → "{{1,2,3},{4,5,6}}" consecutive(3, 5) → "{{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15}}" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 320 Post-solution available
Copyright Nick Parlante 2017 - privacy