Question: String Processin Write a program that manipulates a string entered by the user The program should start by asking the user to enter a word,

String Processin Write a program that manipulates a string entered by the user The program should start by asking the user to enter a word, a sentence, or a string of numbers. Store whatever the user enters into a C++ string The program should then display the following menu USE THIS MENU TO MANIPULATE YOUR STRING 1) Inverse String 2) Reverse String 3) To Uppercase 4) Jumble String 5) Count Number Words 6) Count Consonants 7) Enter a Different String 8) Print the String 9) Quit If the user selects 1: Inverse the upper and lower case letters of the string. If the string contains numeric characters or special characters do not change them. NOTE: This option should actually change the string to its inverse. Note this option does not display I have a code here. I need to fix 2 things. Firstly, when we program count consonants, I should check isalpha and also capital letter a/e/i/o/u. Secondly, when the program counts the number of words, I need to use space here. Help me. Thank you so much. #include #include #include #include #include using namespace std; char change_case (char c) { if (std::isupper(c)) return std::tolower(c); else return std::toupper(c); } char change_uppercase (char c) { return std::toupper(c); } void jumbleString(std::string str) { int x = str.length(); for(int y = x; y > 0; y--) { int pos = rand()%x; char tmp = str[y-1]; str[y-1] = str[pos]; str[pos] = tmp; } cout<<"Jumbled string: "< 0; y--) { if(str[y-1]==' ') { count++; } } cout<<"The string "<>choice; switch(choice) { case 1: std::transform(s.begin(), s.end(), s.begin(), change_case); break; case 2: std::reverse(s.begin(), s.end()); break; case 3: std::transform(s.begin(), s.end(), s.begin(), change_uppercase); break; case 4: jumbleString(s); break; case 5: countWords(s); break; case 6: countConsonants(s); break; case 7: s=""; cout<<"Enter new string: "; cin>>s; case 8: cout<<" String is: "<

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!