Use c++, thank you
Write a function named insertinArray that takes the parameters list as an integer array, size for the capacity of the array, numItems has the number of items in the array, index which is the index where the new item should go, and newVal has the new value to be inserted into the array. If the array is at capacity then the function should return -1, otherwise return 0 for success. int insertInArray(int list[], int size, int* numItems, int index, int newVal) For example, if the array has {9, 2, 8, 3} and the array has the capacity to add a new value, and the new value is ‘5’ at index ‘2’, then the resulting array should be {9, 2, 5, 8, 3} and the function should return 0. You will also need to add one to the numItems variable. Answer: (penalty regime: 0, 5, 10,… %) 1 int insertInArray(int list[], int size, int* numItems, int index, int 2 int timer: 3 if(size==*numItems) 4 return -1: 5 else{ 6 (timer = size: timer > =index + 1: timer–)