X1480: Hash Function: Sum anything but vowels

Write a hash key function that computes the sum of all characters in the string key, ignoring the vowels. Explicitly, this method should NOT add up the value of 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', and 'U', all other characters should be added up.

You may consult the Java documentation on Character and String for other methods to use.

Examples:

hashkey("aeiou") -> 0
hashkey("qwrty") -> 583
hashkey("what a wonderful day") -> 1309

Your Answer:

Feedback

Your feedback will appear here when you check your answer.