c programming 68
At this point in the course we’ve studied both vectors and arrays, and have had some exposure to sort algorithms.
Assignment
Write a program that reads a list of names from the provided file in this module — allNames.txt — and stores them into a vector of strings. The file contains randomly generated last names only.
Using one of the sort algorithms we discussed in Chapter 8 — selection sort or bubble sort, your choice — sort the vector in ascending order. No special comparisons are needed for strings, you can simply use the ‘>’ or ‘<‘ operator to compare (for example, the string “abc” will be less than (<) “def” when compared).
After sorting the vector, output the first 5 and last 5 names in the sort.
For a review of how vectors work, read Section 7.11 of the text (p. 435 – 448, with a good reference table on page 448).
Output
Your program should output exactly the following:
First 5 names:
Abelardo
Agnes
Alexander
Alexandra
Alexandria
Last 5 names:
Zacaras
Yolanda
Yara
Xavier
Witold
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

