AP Computer Science
Write class AddInOrder with a main().
It builds an ArrayList<String> from words typed in to a Scanner.
It adds each word to the list so that the list is in alphabetical order.
For example, if my list has "bat" and "dog", "cat" gets added inbetween.
When you enter an empty line, the list is printed and the program ends.
You can use String.compareTo() to figure out where to add the new words.
Due Monday.
No comments:
Post a Comment