HW 2 – Vwllss (Vowel-less) Due Date: Midnight, Tuesday, February 11, 2020 Problem: Find a way to remove vowels (and optionally certain other groups of characters) from a string. Your assignment:...

Please see the attached file.


HW 2 – Vwllss (Vowel-less) Due Date: Midnight, Tuesday, February 11, 2020 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 consisting of multiple words, including embedded spaces. The program then must use 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. The only input validation is to verify the input string is not empty.  Your program must contain a user-defined function to remove the vowels from a string. The cases of each character in the input string must be preserved in the edited string.  For the purposes of this assignment, vowels include only the letters a, e, I, o, and u in both uppercase and lowercase.  Use any programming techniques that you are comfortable with. You are not restricted to just those techniques covered in the introductory C++ course.  Format your source code according to the style guide presented in class. Bonus 1. Extend the program to remove each 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 character groups and display all of them for each user-input string. These removal operations must be independent in that they each start with the same input string as read from the user. 2. Allow the user to specify an arbitrary group of user-selected characters to remove from the input string. If implemented, this option must be an addition to Bonus 1. Data file: none Turn in a single zip file containing only your source code in one or more “.h” and “.cpp” files. Name the zip file “First Last HW2”, where “First Last” is replaced with your First and Last names. Rubric: Issue Poss. Earned SOURCE CODE Source code is readable and neatly organized 3 3 Source code uses standard C++ input and output statements 3 3 Source code uses standard C++ assignment statements 3 3 Source code uses standard C++ headers (no *.h headers) 3 3 FUNCTIONALITY – TESTED IN MICROSOFT VISUAL STUDIO 0 0 Program prompts the user and reads a string containing one or more words, a phrase, or a sentence 10 10 Program removes all vowels from the input string 15 15 Program leaves original string unmodified 10 10 Program displays the input string and vowel-less string 8 8 Program repeats until the user opts to quit 5 5 BONUS FUNCTIONALITY 0 0 Program removes vowels, consonants, digits, and punctuation from the input string, producing an output string for each set of characters being removed 10 0 Program allows the user to specify a unique set of characters to remove from the input string (only in addition to first bonus option above) 10 0 DEBITS – CODING COMPONENTS AND TECHNIQUES 0 0 Source code not submitted -60 0 Source code not submitted as a C++ source code file (.cpp) -15 0 Assignment submitted to Canvas in separate files instead of a single zip file -15 0 Assignment submitted late -10 0 Program compiles with warnings (will run) -10 0 Program compiles with errors (will not run) -20 0 Program runs with errors or crashes -30 0 No user-defined function to remove vowels from a string -5 0 User input does not accept multiple words with embedded spaces -5 0 Removed vowels are replaced with other characters -5 0 DEBITS - CODING STYLE AND DOCUMENTATION 0 0 Call to main()to make the program repeat -10 0 Use of one or more goto statements -10 0 Use of C-strings instead of string variables -10 0 If statement without a matching else -5 0 Switch statement without default case -5 0 Multiple returns from functions and methods -5 0 Use of magic numbers -5 0 Excessive blank lines -5 0 Not using descriptive names for variables, constants, enums -5 0 Not using descriptive names for functions, methods -5 0 Identifiers not formatted correctly -5 0 Improper indentation (body of every if, switch, do, while, for, try/catch) -5 0 No comments in main() -5 0 No comments in user-defined functions -5 0 No comments in user-defined class, struct, or enum -5 0 Total 60 60
Feb 04, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here