about | help | code help+videos | done | prefs |
add
Write a method named add that returns a string representation of a two-dimensional array of int. The first and second parameters are Strings that represent rectangular two dimensional arrays of ints, representing matrices. Convert them to two dimensional arrays with method toArray(). The resultant array should be the matrix sum: same size, and each element should be the sum of the coresponding elements in the parameters. If the arrays are different sizes, return the string "impossible". Build the array in this method, then use toString() to return the array as a string. You must cut and paste methods toString() and toArray() from the Hint. add("{{2}}", "{{3}}") → "{{5}}" add("{{}}", "{{}}") → "{{},{}}" add("{{}}", "{{3}}") → "impossible" ...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: 335 Post-solution available
Copyright Nick Parlante 2017 - privacy