C++ CodeRunner Problem:
Show transcribed image textWrite a function named insertlnArray that takes the Knowing parameters: listInput a char array cap: capacity of the array numItems: number of items currently in the array index: index at which to insert the new item newVal: value to insert into the array If the array is at capacity then the function should return -1. Otherwise, insert newVal at index and return 0 for success. int insertInArray(char listInput[], int cap, int^x numItems, int index, char newVal) For example, if the array is {‘9’, ‘2’, ‘8’, ‘3’} and it has the capacity to add a new value of 5 at index 2, then the resulting array should be {‘9’, ‘2’, ‘5’, ‘8’ ‘3’} and the function should return 0. The numItems variable will increment from A to 5. Answer: (penalty regime: 0, 5, 10, …%)