Question: Use C++ Write a program that replaces punctuation with whitespace, i.e., a space, as follows: consider punctuation characters as (dot) (comma), '? (question mark),(dash), (single

Use C++

Use C++ Write a program that replaces punctuation with whitespace, i.e., a

space, as follows: consider punctuation characters as "(dot) (comma), '?" (question mark),(dash),"(single quote), you must not modify any characters within a pair of

Write a program that replaces punctuation with whitespace, i.e., a space, as follows: consider punctuation characters as "(dot) (comma), '?" (question mark),(dash)," (single quote), you must not modify any characters within a pair of double quotes (including the double-quotes), and, you will need to disable the skipping of whitespace (on input) to make this program work properly, e.g., see https://en.cppreference.com/w/cpp/io/manip/skipws (but there are also other ways this can be done) You program must process all input from standard input (i.e., std:cin) and write all output to standard output (i.e., std:cout) Clarifications & Tips Based on student feedback from the above here are some clarifications, tips, etc. to help do this assignment In this assignment, do not use 's ispunct() or the ispunct() found within the C++Standard Library. Simply hard-code the checks for punctuation in your code. If a opening double-quotation character is not closed, then everything it output to the screen to the end-of-file/error condition, i.e., don't worry that the quotation mark is not closed. Do not convert double-quotation characters to whitespace #include using namespace std; int main() bool is_within_double_quotes - false; // Use all but one of these "METHOD"s and delete the rest... #1f METHOD-1 // skipws using I0 manipulator noskipws... char byte; while (cin >> noskipws >> byte) #elif METHOD 2 skipws by turning off all skipping of whitespace for cin cin.unsetf(ios_base::skipws); char byte; while (cin >> byte) #else // skipws using unformatted input... // NOTE: Using a char here is important if one wants to write cout

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!