Question: (a) Create a function called makeLayered that takes a single parameter n and returns a square 2D array that has 1 at its centre
(a) Create a function called makeLayered that takes a single parameter n and returns a square 2D array that has 1 at its centre and layers of numbers around this increasing up to and including the value n. For example: makeLayered(3) will return the 2D array 3 3 3 3 2 2 3 1 2 3 2 2 3 3 3 3 (b) Give three test cases for the makeLayered function that will test a range of outcomes. For each test case explain what types of inputs that case is testing and give the expected output. m 33 33
Step by Step Solution
There are 3 Steps involved in it
To solve this problem lets break it down into two parts a Create the makeLayered Function The functi... View full answer
Get step-by-step solutions from verified subject matter experts
