Question: Write the function String pluralForm (String word) which takes a standard English word as a parameter and returns the plural form based on the following

 Write the function String pluralForm (String word) which takes a standard

Write the function String pluralForm (String word) which takes a standard English word as a parameter and returns the plural form based on the following English rules. Punctuation should be preserved. . If the word ends in s, x, z, ch, or sh, add es to the end of the word. . If the word ends in o preceded by a consonant, add es to the end of the word. If the word ends in y preceded by a consonant, replace the y with ies. . For all other cases, add an s to the end of the word. Example runs are shown below. This program converts an English word to its plural form. English word: toy Plural form: toys This program converts an English word to its plural form. English word: toy. Plural form: toys. This program converts an English word to its plural form. English word: toss Plural form: tosses Valid input Each word provided as input will comprise lowercase alphabetic characters. Also, each word may be terminated by one "normal" punctuation mark (i.e., any from ,.!?;). Input words will not contain any spaces, numeric digits, or other unspecified non-alphabetic characters

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!