Write a function "main" that removes all the occurrences of a specified string from a text file. Your program should pro

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a function "main" that removes all the occurrences of a specified string from a text file. Your program should pro

Post by answerhappygod »

Write a function "main" that removes all the occurrencesof a specified string from a text file. Your program shouldprompt the user to enter a string to be removed froma file.
You can use the file with nametest6.txt
Your program should count the words before removing andafter removing the keyword.
Use the message exactly like the samplerun.
Here is a sample run:
<Output>
Enter a keyword to be removed: you
Word count before removing the keyword: 601
count number of you in the text: 10
Word count after removing the keyword: 591
<End Output>
test:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply