I am trying to write a sorting program that prompts input of names and sorts them alphabetically, capitalizing the first letter of each name. I am just simply lost.
I am thinking about splitting the code into two methods one for casing and the other for sorting.
Here's what I got so far for the capitalization bit:
titleCase(String x)
name = x
x.toLowerCase
x.substring(0;)toUppercase
Any help would be greatly appreciated.
The end result should be something like this:
Enter the next name:
zeb
Enter the next name:
rita
Enter the next name:
SUE
Enter the next name:
adele
Enter the next name:
BarBara
Enter the next name:
StoP
[Adele, Barbara, Rita, Sue, Zeb]