Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. The Welsh alphabet consists of the following letters: a, b, c, ch, d, dd, e, f, ff, g, ng, h, i, j. I, I,

image text in transcribed
2. The Welsh alphabet consists of the following letters: a, b, c, ch, d, dd, e, f, ff, g, ng, h, i, j. I, I, m, n, o, p, ph,r,rh,s, t, th, u, w,y Note that there are eight digraphs (two-symbol combinations that count as single letters) in this alphabet: ch, dd, ff, ng, Il, ph, rh, and th. Thus, for example, the town name Llanelli is considered to have only six letters in Welsh (each Il counts as a single letter), whereas it would have eight letters in English. Along these lines, "rhyl has 3 letters, and cymru" has 5 letters. In potentially ambiguous cases like IlI, assume that digraphs precede any single Stony Brook University CSE 114: Computer ScienceI Fall 2017 followed by a single l, for a total letter letters (so would be interpreted as the digraph count of 2) Define a Java method welshLetters() that takes a lowercase String as its only argument (you may assume that the String only contains the letters listed in the Welsh alphabet above, so it won't contain any q's or z's, for instance). Your method should return an ArrayList of Strings, where each String is the next Welsh letter from the argument. ArrayList welshLetters (String word) For example, welshLetters ("1lanelli") would return an ArrayList with the contents (in order): Write a small Java program that demonstrates that your method works correctly. It should prompt the user to enter a Welsh word and display the total number of Welsh letters (and what they are; remember that you can simply pass an ArrayList to System.out.println() for this purpose). For example: Please enter a Welsh word: heddiw Welsh letters: 5/"h* "e", "dd, T, "w]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

ISBN: 0262660709, 978-0262660709

More Books

Students also viewed these Databases questions