Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads in a line of text and outputs the line with all the digits in all integer numbers replaced with 'x'.

Write a program that reads in a line of text and outputs the line with all the digits in all integer numbers replaced with 'x'. For example,

Input:

My userID is john17 and my 4 digit pin is 1234 which is secret.

Output:

My userID is john17 and my x digit pin is xxxx which is secret.

Note that if a digit is part of a word, then the digit is not changed to an 'x'.

For example, note that john17 is NOT changed to johnxx. Include a loop that allows the user to repeat this calculation again until the user says she or he wants to end the program.

Requirement: Read one line - extract each word - validate word to see if all digits - If all digits use erase word from the line, create new word with x and insert it in the same location - Otherwise no changes - Keep in mind you need to keep track of two space positions for each side of your word, except the last one which will have the end of line (use length()) (STRING ONLY !!!)

Step by Step Solution

3.42 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

Question CODE TO COPY include include include using namespace std bool isNumstring str forint i0i if... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
635e029933f2b_180711.pdf

180 KBs PDF File

Word file Icon
635e029933f2b_180711.docx

120 KBs Word File

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Business Communication questions

Question

What should AGC do with its electronics business in 1993?

Answered: 1 week ago