Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Greetings everyone. I need your help creating a plural.c program. I will give a great rate for your answer. Remember the program is C language

Greetings everyone.

I need your help creating a plural.c program. I will give a great rate for your answer. Remember the program is C language and inlvolves these 8 prototypes:

//A function that greets the user void Greeting();

//A function that gets the word from the user void GetWord(char[]);

//A function that changes the word to all uppercase //or all lowercase letters void WordUpper(char word[]);

//A function that determines which rule applies to the word. void WhichRule(char word[], char plural[]);

//applies rule one void ApplyRuleOne(char word[], char plural[]);

//applies rule 2 void ApplyRuleTwo(char word[], char plural[]);

//applies rule 3 void ApplyRuleThree(char word[], char plural[]);

//adds the word to the file void AddToFile(FILE *outPtr, char word[], char plural[]);

*these are the instructions:

Your assignment is to write 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 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)

#define _CRT_SECURE_NO_DEPRECATE #include #include #include

//A function that greets the user void Greeting();

//A function that gets the word from the user void GetWord(char[]);

//A function that changes the word to all uppercase //or all lowercase letters void WordUpper(char word[]);

//A function that determines which rule applies to the word. void WhichRule(char word[], char plural[]);

//applies rule one void ApplyRuleOne(char word[], char plural[]);

//applies rule 2 void ApplyRuleTwo(char word[], char plural[]);

//applies rule 3 void ApplyRuleThree(char word[], char plural[]);

//adds the word to the file void AddToFile(FILE *outPtr, char word[], char plural[]);

*HERE Sample Output:

Sample output for program 3:

********* 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)y Enter a word bunch Rule is 2 Word is BUNCH and plural is BUNCHES Adding the words to the file Would you like to enter a word? Y (YES) or N (NO)y Enter a word COLLege Rule is 3 Word is COLLEGE and plural is COLLEGES Adding the words to the file Would you like to enter a word? Y (YES) or N (NO)y Enter a word FISH

Rule is 2 Word is FISH and plural is FISHES 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 . . .

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

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions