Project for class: inserting file of names and sorting alphabetically...HELP!

this is my assignment:

A teacher has asked all her students to line up single file according to their first name. For example, in one class Amy will be in front of the line and Yolanda will be at the end.

Write a program that will read in a file of names. Names should be read until there are no more names to be read. Use LineUp.txt as a test file for your program.

Once all the names have been read in display which student will be at the front of the line and which one would be at the end of the line. You may assume that no two students have the same name.

These are the name in the LineUp.txt file if needed:
Cooper
Gavin
Joseph
Sierra
Kacie
Dylan
Kaylee
Will
Cameron
Kieron
Samuel
Alexis
Eryn
Emily
McKenna
Brandon
Thomas
Luke
Carlee
Matthew
Elizabeth
Danny
Rachel
Haley
Colleen
Brian
Trey
Noah
Rena
Gillan
Caroline
Cassidy
Kevin
Jason
Zach
Hannah
Dalton
Ian


No clue what to do..
Strings can be sorted using the > and < symbols. This will allow you to sort the names into alphabetical order, then simply output the names in first and last place.

To input a file, check out the fstream library.
Topic archived. No new replies allowed.