// File: ArrayAsk.cpp // Find the extremes in a list of maximum 10 integers. // The list is stored in an array that can hold from 0 to 10 elements. // Data is input interactively using an ask before iterating loop #include #include "utility.h" using namespace std; int const MaxItems=10; int GetData(int []); void FindExtremes(int [],int,int &,int &); void Report(int [],int,int,int); int main() {int List[MaxItems],Items,Min,Max; Items=GetData(List); if (Items) { FindExtremes(List,Items,Min,Max); Report(List,Items,Min,Max); } return(0); } // Read up to MaxItems integers into the first formal argument, // returning the number of items read. // Stop reading when either the user says to or when MaxItems integers are read // Q: Why isn't List prefaced with &, given it is an output argument??? int GetData(int List[]) {int Count=0; char Reply; cout << "Confirm intention to process integers Y/N\n"; // GetAnswer is the Second Condition. What is the problem if it is first?? while ( Count < MaxItems && GetAnswer("YN")=='Y') { cout << "Enter an Integer >"; cin >> List[Count++]; if (CountMax) Max=Values[Index]; else if (Values[Index]