Question: C program that scans words from the keyboard and makes them plural and saves both the original form of the word and the plural form
C program that scans words from the keyboard and makes them plural and saves both the original form of the word and the plural form in an output file called pluralWords.txt. Using 8 user defined functions (thats what i'm struggling with)
Rules :
1. If the word ends in y, remove the y and add ies to the end. Examples: cherry becomes cherries
2. If the word ends with the letters s, ch, or sh then simply add the letters es to the end Examples: bus becomes buses, church becomes churches
3. If the above rules above do not apply then just add the letters to the end of the word. Examples: Mushroom becomes mushrooms
Your program will ask the user if they want to enter a word, then read the word from the keyboard You may use scanf(%s, word); //word is a character array of size 20
After reading each word your program will create either an all upper or all lower version of the word and make a copy of that word.
Next your program will create the plural form of the word and display it on the screen.
Next your program will save the original input word (that is all uppercase or all lowercase), to a file and also save the plural form in the same file.
Your program will repeatedly read in words in English and output singular and plural words to the file until the user decides to quit (by entering n)
You may assume that all input will be typed in alphabetic characters and that no punctuation or numeric characters will be used. You don't need to check this you can simply assume that the input will only contain the letters A through Z and no white space in the words. You do NOT need to verify whether or not the user entered a real word or a nonsense word.
Additional minimal requirements:
****Your program must have a minimum of 8 user defined functions (you may use additional functions) *****
o A function that greets the user o A function that gets the word from the user
o A function that changes the word to all uppercase or all lowercase letters
o A function that determines which rule applies to the word.
o A function for each rule that converts a single word (3 functions)
o A function that saves both words to the output file
Sample Output
: ********* Welcome to the Pluralizer ***********
The output file pluralWords.txt is open
----------------------------------------
Would you like to enter a word Y (YES) or N (NO)? y
Enter a word
funny
Rule is 1 Word is FUNNY and plural is FUNNIES
Adding the words to the file
Would you like to enter a word? Y (YES) or N (NO)n
Thank you for trying out the Pluralizer!
Closing the file pointer
Press any key to continue . . .
Please make sure code has 8 different functions that's what i'm struggling with. Thank you in advance!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
