aspose file tools*
The moose likes Cattle Drive and the fly likes Sorting Names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Sorting Names" Watch "Sorting Names" New topic
Author

Sorting Names

Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
The SortNames assignment requires output of a list of names sorted by first name then an output sorted by last name from same text file names list.
I have a very rough draft that gives the out put following:
Abraham Lincoln
Adam Baum
Bill Joy
Connie Chung
James Gosling
Joe Montana
Justin Case
Walter Cronkite
Baum, Adam
Case, Justin
Chung, Connie
Cronkite, Walter
Gosling, James
Joy, Bill
Lincoln, Abraham
Montana, Joe

This is how one would normally see a list of names sorted by last name. However, I suspicion this MAY not be what is desired by the instructor. My question is: is it?
Thanks


doco
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
If I remember correctly, I believe commas fall into the "advanced assignments" category.
Oh! Or do you mean: do the names have to be printed "lastname firstname". Nope, I don't think I did that, but they definitely were sorted on lastname.
All so hazy and faded...
[ May 06, 2003: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
The output should look like:

Abraham Lincoln
Adam Baum
Bill Joy
Connie Chung
James Gosling
Joe Montana
Justin Case
Walter Cronkite

Adam Baum
Justin Case
Connie Chung
Walter Cronkite
James Gosling
Bill Joy
Abraham Lincoln
Joe Montana


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
Just as I was afraid it would be
 
wood burning stoves
 
subject: Sorting Names