Answered step by step
Verified Expert Solution
Link Copied!

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++,
please read the question carefully and solve using 2 functions as required
image text in transcribed
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

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions