function prototypes void selectSort( int list[], int n); void printList ( const int list[], int len, const string&);
const int MAX_SIZE = 100;
const int SENT = -1;
What will be an ideal response?
```
int main()
{
int size;
bool done;
int testSent;
char stayIn;
int list[MAX_SIZE];
int i;
do {
cout << "Enter " << MAX_SIZE << " or fewer numbers to form a list ("
<< SENT << " when finished)..." << endl;
done = false;
for( i = 0; i < MAX_SIZE && !done; i++)
{
cout << setw( 2 ) << (i + 1) << "=> ";
cin >> list[i];
if( list[i] == SENT ) //end of data entry sentinel
done = true;
}
if ( !done ) {
size = MAX_SIZE;
cout << setw( 2 ) << (i + 1) << "=> ";
cin >> testSent;
if ( testSent != SENT )
cout << "Too much data, first " << MAX_SIZE << " items used."
<< endl;
} else {
size = i - 1;
}
cout << endl;
printList( list, size, "Original List..." );
selectSort( list, size );
printList( list, size, "Sorted List..." );
cout << "Do you wish to continue[y/n]? ";
cin >> stayIn;
cout << endl;
} while (stayIn == 'y');
return 0;
}
```
You might also like to view...
You are designing a loop that is to exit only if the values of both x and y are 0. Which of the following would you use for your loop repetition condition?
a. x != 0 && y != 0 b. x != 0 || y != 0 c. !(x != 0) || !(y != 0) d. x == 0 && y != 0
What is a reference work of data about data compiled by systems analysts?
A) data dictionary B) data flow diagrams C) structured analysis D) design
Use the AutoFit button to make all columns in a table the same width.
Answer the following statement true (T) or false (F)
Which of the following is a device directly used by an end user to access a network?
a. Server b. LAN c. Client d. Router