#include <iostream>
#include<cstdlib>
#include<ctime>
double getAverage(int[],int);
usingnamespace std;
int main()
{
constint 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 " <<high<<endl << "The lowest number is " << low<< endl<< "The average is " << average << endl;
}
elseif (input == 2)
{
int number;
cout << "Add a number" << endl;
cin >> number;
}
return 0;
}