Answered step by step
Verified Expert Solution
Question
1 Approved Answer
solve using c++, please read the question carefully and solve using 2 functions as required Question 2: Write and test a program that reads the
solve using c++,
Question 2: 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* readWords(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 retum 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 o if noun ends in "y" remove the "y" and add "jes" o if noun ends in "s" or "sh" add "es" all other cases just add "s" 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 please read the question carefully and solve using 2 functions as required
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