Lab 14 - Friends File

     Insertion Sort (10:40) min<--
     Insertion Sort, when the new entry goes in the last position (4:25 min) <--

Grader

For this project you will modify Lab 13 to insert new friends in the arrays so that the arrays are maintained in alphabetic order by last name. Since your current file is not in order by last name you will need to delete the existing file and begin with a new file. It may be a good idea to create a file in Notepad with a few friend records in the appropriate order.

The code to maintain the order of the friends will be added to the Add Friend logic.

When a new friend is added you will

Form Load

Unique numbers will continue to be assigned to each new friend but because the friend records will be stored in alphabetic order the records will no longer be in key field value order.

To determine the next available key field value save the largest key field value read from the file. The first new friend will be assigned a key field value 1 larger than the largest already assigned to a friend.

Because the arrays will be maintained in order the file will also be in the correct order when you save it to permanent storage.