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...

Wavy red and green lines that appear below segments of text indicate ________

A) a style change from previous text B) the start of a new paragraph C) flagged errors D) presence of formatting marks

Computer Science & Information Technology

Measures to maintain data availability do not include redundant systems' disk array and clustered machines, antivirus software to stop worms from destroying networks, and distributed denial-of-service (DDoS) prevention systems.

a. true b. false

Computer Science & Information Technology