Question: please write the code in c++. and follow the instructions given on excerise 1: censoring. also i have added thr picture of book1.txt and book2.txt.




please write the code in c++. and follow the instructions given on excerise 1: censoring.
also i have added thr picture of book1.txt and book2.txt.
and functions must be placed before main also.
please use commenting so that i can understand the whole program and try to so step-by-step. it makes things easier for me to understand.
thank you. if you need more information, let me know.
Mordech.Lab 10- t) Lab 10DX G chase cu (New Tab b%2010.pdf D New Tab n Facebook w Admission counselo-O search 2004 Acura TL Gre.... Vendor Infor Exercise 1: Censoring Download book1.txt and book2.trt. Create, complete and submit lab10_1.cpp file. Write a program that censors books. We have provided the program outine below 1, main a. Ask the user to input a censorWord (this is the 'bad' word that we are removing) b. Ask the user what file to read from C. Open the file d. For each sentence in the file i Censor it i. Print it to the terminal e. Close the file 2. void censorSentence (string censorWord, string& sentence) a. b. Create a replacementWord containing the correct number of asterisks While censorWord is still in sentence i. Find the position of censorWord i. Replace censorWord with asterisks (Hint: use the createAsterisksWord function below] 3. string createAsterisksword (int numAsterisks) a. Initialize an empty string b. For the number of asterisks we want Concatenate asterisks onto our string Testing bash-4.1$ gt+ lab10 1.cPp: ./a.out Enter the censor word(s) : hydrogen dioxide Enter the file to read from: bookl.txt The secret formula contains. The secret ingredient is in our secret hideout in a secret box Test your program with the following censors: secret, the, i Test your program with book 1.txt and book2 txt Hints When opening the file, use myFile . open (myFilename variable. c-str Consider whether you want >s or getline to input data You don't know how many lines are in the file: which loop type is better for an unknown size . )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
