Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please provide simple c++ code only URGENT Write and test a program that reads the content of the file word by word, convert each word
please provide simple c++ code only URGENT
Write and test a program that reads the content of the file word by word, convert each word to plural form and print it back to the user in reverse order. Develop the following function: string* read Words(string file name, int& size): This function should read the file given by file_name word by word, save the words into an array of strings an return it to the called, the function need to open the file twice, one to count the number of words and the other time is to read them into the dynamic array. Develop the following function: string change_to_plural (string word); Use the following rules: . if noun ends in "y" remove the "y" and add "ies" if noun ends in s or sh" add "es" all other cases just add "3" Complete the following main: int main() { //TODO 1: declare all required variables //TODO 2: read all the words in the file input.txt into a dynamic array using the readWords function. //TODO 3: print the words in plural form to the user in reverse order //TODO 4: free any dynamic memory } For the following input file: input.txt chair diary boss circus fly dog clue dish Your program should print: dishes clues dogs flies circuses bosses diaries chairs Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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