Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java program question: Write the function String PluralForm(String word) which takes a standard English word as a parameter and returns the plural form based on

Java program 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 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.

Here are three examples of the output, software is very picky so it has to look exactly like this unfortunately:

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 

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

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

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions

Question

Define Administration?

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago