Question: 6 . 9 Lab Exercise Ch . 6 a: Functions: String analyzer Create and debug this program in Visual C + + . Upload your

6.9 Lab Exercise Ch.6a: Functions: String analyzer
Create and debug this program in Visual C++. Upload your Source.cpp file for testing.
(1) Prompt the user to enter a string of their choosing. Output the string.
Ex:
```
Enter a sentence or phrase:
The only thing we have to fear is fear itself.
You entered: The only thing we have to fear is fear itself.
```
(2) Write a function: int CountWhitespace(string s)// returns the number of whitespace characters (spaces and tabs) in string s This function should NOT print anything.
*Note: A tab is '1 t '.
(3) In main(), call the CountWhitespace() function and then output the returned result.
(4) Implement a function:
void OutputWithoutWhitespace(string s)//prints the string's characters, all on one line, except for whitespace (spaces, tabs).
Also call OutputWithoutWhitespace() to print the string without whitespace.
Sample program run:
```
Enter a sentence or phrase:
The only thing we have to fear is fear itself.
You entered: The only thing we have to fear is fear itself.
Whitespace count: 9
String with no whitespace: Theonlythingwehavetofearisfearitself.
```
6 . 9 Lab Exercise Ch . 6 a: Functions: String

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 Programming Questions!