Question: This is C++ i am not sure on why my code is not creating the correct answer here it seems to be duplicating choose an

This is C++ i am not sure on why my code is not creating the correct answer here it seems to be duplicating choose an option and i am not sure why.

Code

#include #include

using namespace std;

char printMenu(); int GetNumOfNonWSCharacters(string); int GetNumOfWords(string); void ReplaceExclamation(string&); void ShortenSpace(string&); int FindText(string, string);

int main() { char option; string text, phraseToFind; cout

} } cout > ch; return ch; } int GetNumOfNonWSCharacters(const string text){ int cnt = 0, i; int len = text.size(); for(i=0; i

while(isspace(text[i])) i++; words++; } else{ i++; } } words = words + 1; return words; } void ReplaceExclamation(string& text){ string newText = text; int i, len = text.size(); for(i=0; i

Errors

This is C++ i am not sure on why my code is

not creating the correct answer here it seems to be duplicating choose

6. Compare output We'll continue our guest in space. There will be more shuttle flights and r Input n Spaces g Quit. Choose an option: Number of non-whitespace characters: 181e Your MENU output ends. c Number of non-whitespace characters with w Number of words f Find text r Replace all 's s Shorten spaces g Quit Choose an option Number of non-white space characters 181 MENU c Number of non-whitespace characters Expected w Number of words output f Find text ends. r Replace all 's with s Shorten spaces g Quit Choose an option

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!