Reference no: EM131069319
1. Given an array of words, return an array of integers to tally how many words starting with ‘a', ‘b', ..., ‘z' (suppose the words are case-insensitive). For example, if the array of words is ["apple", "cat", "dog", "Ann"] then the array returned is [2, 0, 1, 1, 0, ..., 0], where the first four elements are 2, 0, 1, 1, respectively, the rest 22 entries are all zeros.
Explanations:
There are a total of 26 letters in English alphabet, so the returned array should hold 26 integers.
The first element in the returned array represents the number of words starting with ‘a' or ‘A'. There are two such words in the given array - "apple", "Ann", so the first entry of the returned array is 2.
The second element in the returned array represents the number of words starting with ‘b' or ‘B'. There is no word starting from ‘B' or ‘b'in the given array, so the corresponding entry is 0.
You can draw similar conclusion for the rest entries.
Your can only visit the elements in the given array for once (that, use only one loop).
(1) Write a pseudocode for this method.
(2) Implement your pseudocode into actual working java code. Test your method by main method with a given array with the following entries:
"Randolph", "Muzakkir", "Anthony", "Scott", "Zachary", "Anisha", "Courtney", "Benjamin G.", "Merium", "Salman", "Dennis", "Shehzuni", "Syed Humza", "Dimitrios",
"Benjamin X.", "Kwasi"