Question: Write a method getPronunciation that accepts a single String containing a potential Hawaiian word and returns a String containing the pronunciation guide. If the passed

Write a method getPronunciation that accepts a single String containing a potential Hawaiian word and returns a String containing the pronunciation guide. If the passed String is null or invalid, throw an IllegalArgumentException.
Hawaiian Characters
There are 12 valid characters in the Hawaiian language: a, e, i, o, u, p, k, h, l, m, n, and w. Each Hawaiian word passed into our program must be inspected to ensure it contains only these characters, because if it does not, then we dont have a valid Hawaiian word. If the passed word is not valid, throw an IllegalArgumentException. Note that you do not need to handle spaces or any other characters. You should ignore case when examining the input String, but your pronunciation guide output String should be all lowercase.
The consonants in the Hawaiian language are pronounced similarly to the English versions. The only exception is 'w', which is pronounced as a "v" if it follows an 'i' or 'e' and pronounced as "w" otherwise.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!