LAB 6: Sorting a list of names

Due: 9:30 am, Tuesday, 10/01/02

Write a C++ program which does the following


repeat

Ask user how many names (s)he wants to sort: n

Create an array of strings of size n

Sort the array in ascending order

Print out the sorted array

until user says no


Notes:

1. Try to use functions as much as you can

2. Pay attention to the problem of "mixing cin>> variable; and getline" discussed on page 672-3 of the textbook. You will have to deal with this problem.

3. A name may consist of several words. So you should be able to read a full line of input for each element of the array.