Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Find a way to remove vowels (and optionally certain other groups of characters) from a string. Your assignment: Design, develop, and test a C++

Problem: Find a way to remove vowels (and optionally certain other groups of characters) from a string. Your assignment: Design, develop, and test a C++ program that prompts the user to input a string. The program then uses a user-defined function to remove all the vowels from the string. Do not replace the vowels with a space or any other character. For example, if str = There, then after removing all the vowels, str = Thr. After removing all the vowels, output both the original and edited strings. Discussion: Removing characters from a string involves two operations: 1) recognizing which characters in the string fall within the group being removed, and 2) removing those characters from the string. Consider the following steps to accomplish these tasks. Develop a function that accepts a string, examines the characters in the string, and removes each character that is a member of the group known as vowels. Each vowel must be removed, and not replaced with another character. The function must return a new string, and not an edited version of the original string. The cases of all characters in the new string must match those of the original string. The prototype for this function should be like string noVowels(string s);. Write a main program that reads a string of one or more words with embedded spaces from the console, uses the user-defined function (described above) to remove all the vowels from the input string, and then displays the input string and vowel-less edited string. Repeat till the user opts to quit. Coding Accept any sequence of characters, including multiple words with embedded spaces from the input. Validate all inputs and do not proceed until valid inputs are available. Your program must contain a user-defined function to remove the vowels from a string. For the purposes of this assignment, vowels include only the letters a, e, I, o, and u in both upper case and lower case. Format your source code according to the style guide presented in class. Bonus Enhance the program to remove all of the following groups of characters from the input string: vowels, consonants, digits, and punctuation. Your program must produce a separate output string for each of the letter groups and display all of them for each user-input string. Allow the user to specify an arbitrary group of user-selected characters to remove from the input string. This option must be in addition to the previous bonus feature.

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_2

Step: 3

blur-text-image_3

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

State why people resist change and how to overcome resistance.

Answered: 1 week ago

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago