### NEED HELP WITH ARRAY MENU

I need help with options 6 and 4 in the menu.

0. Create array: Asks user how many numbers to fill (the length of the partially filled array), with
random numbers 0-99. First fill all 100 elements with zeroes then insert as many random
numbers as specified by the user. Validate the user entered number (1-99).
1. Calculates and prints the highest value, lowest, sum, and average of the partially filled array.
2. Add a number to the end: asks user to enter a number and adds it to the end of the partially
filled array.
3. Find index of a number: Displays the index of a number if it exists otherwise a message
4. Insert number at index: Ask the user to enter a number and the index to insert it in. Display
error message if the specified index is outside the current partially filled array size.
5. Remove number: Ask the user to enter a number, remove it if it exists otherwise display a
message to indicate that it does not exist.
6 Remove number at index: Ask the user to enter the index. Remove the number at the
specified index or display error message if the specified index is outside the current partially
filled array size.
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159`` `````` #include #include #include using namespace std; int main() { const int LENGTH =100; int array[LENGTH]; srand(((unsigned)time(0))); int cnt = 0; cout << "Enter the length of the array: " ; cin >> cnt ; if( cnt > LENGTH ) cnt = LENGTH ; for( int i = 0; i < cnt ; ++i ) array[i] = 1 + rand() % 100; for( int i = 0; i < cnt ; ++i ) cout << array[i] << ' ' ; cout << '\n' ; int input; cout << "Enter your menu choice" << endl; cout << "1. Find high, low, sum average" << endl; cout << "2. Add a number to the end" << endl; cout << "3. Find the index of a number" << endl; cout << "4. Insert number at index" << endl; cout << "5. Remove number" << endl; cout << "6. Remove number at index" << endl; cout << "7. Quit" << endl; cin >> input; if (input == 1) { int sum = 0; int average = 0; int high = array[0]; int low = array[0]; for (int dx = 0; dx < cnt; dx++) { sum += array[dx]; if(array[dx] > high) high = array[dx]; if(array[dx] < low) low = array[dx]; } average = sum/ cnt; cout << "The highest number is " <> number; for( int i = 0; i < cnt ; ++i ) cout << array[i] << ' ' ; cout << number; } else if ( input == 3){ int TheNum =0; int i =0; cout << "Number to search for: "; cin >> TheNum; for(i = 0; i < cnt; i++) { if(array[i] == TheNum){ cout << TheNum << " is at index " << i << endl; for( int i = 0; i < cnt ; ++i ) cout << array[i] << ' ' ; cout << '\n' ; } } if(TheNum!=cnt){ cout << TheNum << " does not exist" << endl;} } else if (input == 4){ int number =0; int index =0; cout << "Enter a number to insert\n" ; cin >> number; cout << "Enter the index to insert\n"; cin >> index; for( int i = 0; i < cnt ; ++i ) cout << array[i] << ' ' ; cout << number; } else if (input == 5){ int del = 0; int count = 0; cout << "Enter a number to remove" << endl; cin >> del; for(int i=0; i>index; for(int i=0; i
Helllo,

 0. Create array: Asks user how many numbers to fill (the length of the partially filled array), with random numbers 0-99. First fill all 100 elements with zeroes then insert as many random numbers as specified by the user. Validate the user entered number (1-99).