954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sorting code

Hey i have a program that i need to write where a user has to enter 3 names and then my program has to spit them back in alphabetical order. i know how to display the answers i just dont know how to code it to get the answer :/ EX. if i entered Charlie, Leslie, and Andy, the program needs to display:

"Andy"
"Charlie"
"Leslie"

I dont know how to get the program to order them that way. I know that i have to use temps, but im not sure how to implement them correctly.
If anyone could give me a little insight, it would be greatly appreciated.
Thanks

Java4A
Newbie Poster
1 post since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

If you had three pieces of paper with the names written on them and four slots on the table where you could lay the pieces of paper, 3 holding the papers with the names and one empty,
How would you move the pieces of paper one at a time from its current location to an empty slot and end with the names in order? The empty slot is the temp slot and will be empty at the end of the movements.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: