id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

simona1@sfusd.edu two_d_arrays > multiply
prev  |  next  |  chance

Write a method named multiply 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 product. Refer to a math text for how to multiply matrices. 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.


multiply("{{2}}", "{{3}}") → "{{6}}"
multiply("{{2,5}}", "{{3},{7}}") → "{{41}}"
multiply("{{3},{7}}", "{{2,5}}") → "{{6,15},{14,35}}"

...Save, Compile, Run (ctrl-enter)

public String multiply(String as, String bs) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 355 Post-solution available

Copyright Nick Parlante 2017 - privacy