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 

(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

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem lets break it down into two parts a Create the makeLayered Function The functi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!