Description: 1. Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors should be used as keys, and the predefined Color objects should be used as values. Place this class in a package that can be imported into any Java program. Use your new class in an application that allows the user to a color and draw a shape in that color.
2. (Counting Duplicate Words) Write a program that determines and prints the number of duplicate words in a sentence. Treat uppercase and lowercase letters the same. Ignore punctuation.
3. (Sorting Words with a TreeSet) Write a program that uses a String method split to tokenize a line of text input by the user and places each token in a TreeSet. Print the elements of the TreeSet. [Note: This should cause the elements to be printed in ascending sorted order.]
4. (Generic isEqualTo Method) Write a simple generic version of method isEqualTo that compares its two arguments with the equals method and retur
To Search:
File list (Check if you may need any files):
lab11\.classpath
.....\.project
.....\.settings\org.eclipse.jdt.core.prefs
.....\bin\exercise1\Draw.class
.....\...\.........\HashMap_Color.class
.....\...\........2\CountWords.class
.....\...\........3\SortWords.class
.....\...\........4\GenericIsEaqual.class
.....\...\........5\Pair.class
.....\...\.........\Program.class
.....\src\exercise1\Draw.java
.....\...\.........\HashMap_Color.java
.....\...\........2\CountWords.java
.....\...\........3\SortWords.java
.....\...\........4\GenericIsEaqual.java
.....\...\........5\Pair.java
.....\...\.........\Program.java
.....\bin\exercise1
.....\...\exercise2
.....\...\exercise3
.....\...\exercise4
.....\...\exercise5
.....\src\exercise1
.....\...\exercise2
.....\...\exercise3
.....\...\exercise4
.....\...\exercise5
.....\.settings
.....\bin
.....\src
lab11