Write a method that computes the frequency (as a percentage between 0.0 and 1.0) of each letter A-Z or a-z in a string. Don't distinguish between upper- and lowercase letters. Return an array of length 26. The ith element contains percentage of the letter 'a' + i or 'A' + i among the letters in the string. The string may contain other characters that you should simply skip.

Complete the following file:


public class Letters { /** Counts the frequencies of letters A-Za-z in a string @param str a string @return an array of 26 percentages. The i-th count is the percentage of occurrences of 'A' + i or 'a' + i among all letters (a number between 0.0 and 1.0). */ public double[] letterFrequencies(String str) { // Your work here } }