**Assignment:**

Write a program that prompts the user to enter a series of integers with -1 being the sentinel integer. Store the integers in an array. You can assume a max of 10 integers. Then, print the integers entered, the minimum of those integers, and the maximum of those integers. Place your program in a single file named maxmin.cpp.

Start with the following function prototypes:

**int minimum(const int* values, size_t numValues);**

int maximum(const int* values, size_t numValues);

int maximum(const int* values, size_t numValues);

Next, define the following constant in your main() function:

**const size_t maxValues = 10;**

Your first task will be to implement the minimum() and maximum() functions. You see that both functions take in a pointer to a integer and the number of values. Effectively, you are passing in your array and the size of your array (which will be 10 or less). For the minimum() function, use array subscript notation. That is, use brackets, but not the *. For the maximum() function, use pointer/offset notation. That is, do not use any brackets.

Your next task is to ask the user to enter up to 10 integers. You can assume that at least one valid integer will be entered. Use -1 as the sentinel value (i.e. -1 stops the entering of numbers and is not included in the array). Print the values that were entered and the min and max of those values. Note that if the user enters over 10 integers, only the first 10 will be counted.

#include <iostream> using namespace std; //function prototypes int minimum(const int* values, size_t numValues); int maximum(const int* values, size_t numValues); int main() { const size_t maxValues = 10; const int SENTINEL = -1; int i; int array[i]; int array[maxValues]; int min = array[0]; int max = array[0]; int numValues = 0; while (array[i] != SENTINEL) //need this to stop if -1 is entered { cout <<"Enter up to 10 integers (-1 to stop):" <<endl; for (int i = 0; i < maxValues; i++) //loops through array cin >> array[i]; numValues++; } minimum (min, numValues); //not sure how to implement function maximum (max, numValues); //not sure how to implement function cout << "Values entered:" << array[i]<<endl; //need to print full array cout << "Minimum value:" << min <<endl; //need to print minimum cout << "Maximum value:" << max <<endl; //need to print maximum } //to find max/min for (i = 0; i < numValues; i++) { if (array[i] < min ) { min = array[i]; } else if (array[i] > max ) { max = array[i]; } }