Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Having trouble coding this using Java. Plural Form Problem Description Write the function string PluralForm (string word) which takes a standard English word as a
Having trouble coding this using Java. Plural Form Problem Description Write the function string PluralForm (string word) which takes a standard English word as a parameter and returns the plura 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 add es to the end of the word. replace the y with ies word. . If the word ends in o preceded by a consonant, If the word ends in y preceded by a consonant, For all other cases, add an s to the end of the Example runs are shown below This program converts an English word to its plural for English word: toy Plural form: toys This program converts an English word to its plural for English word: toy Plural form: toys This program converts an English word to its plural for 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., an 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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started