· Gain practice with loops, especially iterating over arrays and objects indexed like arrays, such as Strings.
· Gain practice with arrays
· Learn a little about how to treat characters and integers and what it offer
1. At a high level, your program should:
a. Read in a String
b. Count the letters in the String (you will want a loop)
i. Ignore the case of the letters (may be advantageous to do something before beginning counting)
ii. Ignore any non-letter characters (you need to skip/not count but not crash on non-letter characters)
iii. Use charAt() to index the input String (indexed like an array)
iv. DO NOT declare 26 different variables, one for each letter. You’ve seen arrays, so use one 26 int one to store the count of each letter.
v. Consider the following code. It will give you the distance of a character “from ‘a’”. Remember, the characters in Unicode are in order, at least ones of the same case. You can use this to index an array.
int d = c-'a';
c. Output the results (you will want a loop)
i. Only output the letter counts of letters in the String (focus on the next step first, this is easy to add on once it is done). See the sample output.
ii. In order to use the array index to get a character, you can use the following snippet, which will “convert” an integer index d, with 0 at ‘a’, into a character you can print.
(char)(d+'a')
2. Sample output:

(Notice in the second case that capitalization, punctuation, and spaces do not matter)
1. What would you have to change to do a large amount of text that might contain all 2^16 possible Unicode values (~65,000)? Think through the changes you would have to make.
2. How would you do 1 without arrays?