Question: Write a method that computes how often each letter A-Z or a-z occurs in a string. Don't distinguish between upper- and lowercase letters. Return

Write a method that computes how often each letter A-Z or a-z occurs in a string. Don't distinguish between upper- and lowercase letters. Return an array of length 26. The ith element contains the number of times that the letter 'a' + i or 'A' + 1 occurs in the string. The string may contain other characters that you should simply skip. Letters.java public class Letters 1 2 { 3 /** 4 Counts the frequencies of letters A-Za-z in a string @param str a string @return an array of 26 counts. The i-th count is the number of occurrences of 'A' i or 'a' + i. public int[] letterFrequencies (String str) // Your work here 56982OENEN 7 */ 10 { 11 12 13 14 } 15 }
Step by Step Solution
3.56 Rating (146 Votes )
There are 3 Steps involved in it
Heres a method letterFrequencies that computes the frequencies of letters AZaz in a given string Exp... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
663d524a6de5b_968028.pdf
180 KBs PDF File
663d524a6de5b_968028.docx
120 KBs Word File
