Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description (It has to work with c++ thank you) The purpose of this challenge is to manually manipulate character arrays. This challenge converts specific English

Description (It has to work with c++ thank you)

The purpose of this challenge is to manually manipulate character arrays. This challenge converts specific English word to its plural. This challenge focuses on words that end in the letter y.

Requirements

Write a program to determine the plural version of English nouns that end with the letter y.

Create a void function void yplural(char after[], char before[]). This function should be case-insensitive. Do NOT cout in this function. The after array represents the plural form. The before array represents the original word.

Declare a char array to hold a maximum of 50 characters to receive the user input.

Ask the user to enter a string. Use cin.getline(input, 50) function call to get the string from the user, where input is a character array that receives the user input.

The rule for pluralizing most English words that end with the letter y goes as follows: If the word ends with -y but the second-to-last letter is a vowel, then simply add a letter -ys to create its plural form. If the word ends with -y, but the second-to-last letter is a consonant, then the y is replaced with ies to create its plural form. As with most rules, there are going to be exceptions; ignore those words during your testing. See the sample interaction below for some example words.

Show the pluralized word

You may need to write other functions to make your code easier. Its up to you.

Sample Interaction / Output

Enter a word: attorney The plural of attorney is attorneys 

Run it again

Enter a word: nanny The plural of nanny is nannies 

Run it again

Enter a word: granny The plural of granny is grannies

Run it again

Enter a word: donkey The plural of donkey is donkeys

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What is the harm if visual aids are overused?

Answered: 1 week ago