Write a code segment that will read a sentence from the keyboard, terminated with a period '.' and write the sentence to the screen with all white space (blanks, tabs, , replaced by the symbol '*'. Use library a function to carry out the determination of whether the character read is 'white space'. Show any #include files you may need.

What will be an ideal response?


```
#include // for isspace
#include
using namespace std;

int main()
{
char ch;
do
{
cin.get(ch);
if(isspace(ch))
cout << '*';
else
cout << ch;
} while ('.' != ch);
cout << endl;
return 0;
}
Typical run:
The first line is input, the second is output from the
program:

Now is the time for all good men to come to the aid
Now*is*the*time*for*all*good*men*****to*come*to*the*aid
```

Computer Science & Information Technology

You might also like to view...

____ is a monitoring and reporting tool.

A. Application and defect security B. Defect and system security C. Application and process security D. Application and system security

Computer Science & Information Technology

Initially, a ResultSet cursor is positioned _________.

a. before the first row b. at the first row c. at the last row d. after the last row

Computer Science & Information Technology

____ typically creates larger file sizes than GIF, but the quality of the transparency is much higher.

a. TIFF b. PNG c. JPG d. BMP

Computer Science & Information Technology

An array created during the execution of a program is called a ____ array.

A. static B. final C. just in time D. dynamic

Computer Science & Information Technology