Question: Write a method, fill, that takes two parameters, a 2D array of strings, m, and a String, name, and fills the entries of the 2D
Write a method, fill, that takes two parameters, a 2D array of strings, m, and a String, name, and fills the entries of the 2D array with single letters from the string in column-major order. When called, the assumption is that array mexists and has a definite size. If the string name has fewer letters than the matrix has entries, then all the remaining entries should be set equal to an empty string. If String name has more letters than there are entries in the given matrix, then only as many letters are used as are entries in the 2D array are placed. For example: if mis 2 x 3 and we call fillim, "DULUTH") the resulting matrix m will be L U T H if mis 2 x 3 and we call fill(m, "WILDCATS") the resulting matrix m will be W 1 L D ifm is 2 x 3 and we call fill(m, "CAT") the resulting matrix m will be MA T MN NAF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
