Khan.randRange(4, 6) Khan.randRange(0, 999) Khan.randRange(0, arr_size-1) staticArrayListAddPRO.initJSAV(arr_size, add_pos,add_value)

Your task in this exercise is to show the behavior for adding elements to an array-based list.

In the array displayed below, your task is to add add_value at position add_pos.

To move an element, click on it (to highlight it), then click on where you want it to go. You can insert the new value add_value into a highlighted array position by clicking the "Add" button.

[staticArrayListAddPRO.userInput]
if (!staticArrayListAddPRO.checkAnswer() && !guess[0]) { return ""; // User did not click, and correct answer is not // initial array state } else { return staticArrayListAddPRO.checkAnswer(); }

To shift elements one position to the right, the first step could be swapping element arr_size-1 with position arr_size

Then, keep swapping element i with i+1 until you make the insertion position empty for insertion