about | help | code help+videos | done | prefs |
allocate
Write a method named allocate 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. All the elements should be zero, the default value for int. For example, allocate(2,3) should return {{0,0,0},{0,0,0}}. Create 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. allocate(2, 3) → "{{0,0,0},{0,0,0}}" allocate(3, 5) → "{{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}}" ...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: 310 Post-solution available
Copyright Nick Parlante 2017 - privacy