Element Move (C++)
Implement the initialize function: Initialize the array with dashes '-' place 'A' on the eleventh element (index 10) Implement the moveElement function: If movement is positive, move the character 'A' to the right equivalent to the value of movement. If movement is negative, move the character 'A' to the left instead. Use the code the below // DO NOT EDIT THIS PORTION #include <iostream> using namespace std; void initialize(char e[21]); void moveElement(char e[21], int movement); void displayElements(char e[21]); int main() { char elements[21]; int movement=-1; initialize(elements); displayElements(elements); do { cin >> movement; moveElement(elements, movement); displayElements(elements); } while (movement != 0); return 0; } void displayElements(char e[21]) { for (int i=0; i<21; i++) cout << e[i]; cout << endl; } // PLACE YOUR CODE UNDER THIS COMMENT