Question: I need to write a program in Java that will determine if a user entered program is a haiku. Summery below: For this assignment, we

I need to write a program in Java that will determine if a user entered program is a haiku. Summery below:

For this assignment, we will determine if a user poem is a Haiku. We will use one of the definitions of a Haiku as three sentences which have a syllable count of 5-7-5. For example, consider the following:

First autumn morning:

the mirror I stare into

shows my father's face.

-- Murakami Kijo

This Haiku written by Murakami Kijo follows the rule of 5 syllables in the first sentence, 7 in the second, and 5 in the last. We will ask the user for three lines and determine if it is a valid Haiku.

Specifications:

Create a new Project Haiku with a Main class.

2.Prompt the user for three lines of text.

3.Count the syllables for each word and display the word followed by the syllable count.

a.At the end of each line, display the total syllable count.

b.After all the lines, display the total syllable count.

c.Display if the Haiku is valid or not. If it is not valid, indicate if the user is missing or has too many syllables and on which line(s).

4.Counting syllables can be very difficult, so let us use this simple algorithm, which is not perfect, but is close enough for this assignment.

a.Each group of adjacent vowels (a, e, i, o, u, y) counts as one syllable for example, the ea in real contributes one syllable.

b.However, the e ... a in regal counts as two syllables.

c.Lastly, an e at the end of a word does not count.

d.Remember each word must have at least one syllable.

5.You must break your solution into methodsConsider the following:

a.boolean is Vowel(char letter)

b.int count Syllables (String word)

c.String getLine(String prompt)

d.String getAnalysis(String poem) // Gets the complete output.

The output should look something like this:

First(1) autumn(2) morning(2) Line total - 5

The(1) mirror(2) I(1) stare(1) into(2) Line total - 7

Shows(1) my(1) fathers(2) face(1) Line total - 5

Total syllable count 17 - Valid Haiku

This is my first time posting a question on here, the assignment is due tomorrow, please help!

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 Databases Questions!