//fun5.cpp //csci107, Laura Toma //Fill in the function sum_array #include const int size=10; //************************************************************ //a function that reads an array of n elements from the user; n is //assumed to be known void read_array(int a [], int n) { int i = 0; cout << "Please enter an array of " << n << " elements: \n"; while (i > a[i]; i = i+1; } } //************************************************************ //a function that prints an array of n elements; the array and n are //assumed to be known void print_array(int a[], int n) { cout << "the array is: "; cout << endl; } //************************************************************ //a function that computes and returns the sum of all elements in the //array a of n elements; a and n are assumed given int sum_array(int a[], int n) { int sum = 0; return sum; } //************************************************************ int main() { int x[size], s; read_array(x,size); print_array(x,size); cout << "the sum of all elements in the array is: "; s = sum_array(x,size); cout << s << endl; return 1; }