The 10 Write a Class called Censor. It should have a static method censor (File source,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The 10 Write a Class called Censor. It should have a static method censor (File source, File destination, File badlist) that reads each line in badlist and then replaces any occurrence of a word (or words) specified on a line in badlist in the source file, putting the new text in the destination file. The replacement should consist of the same number of characters as the replaced text length. If should not match across linebreaks. You can (and should) use anything in the String class, anything related to regular expressions and your preferred File 10 from the java.10 package. You should code everything else on your own. Your submission should include an appropriate text chosen by you, no longer than 20k, an amusing badlist file and the resulting output in a third file. You should have a main method that uses the first two files to generate the third. Example: with badlist "foo", "bar" and input "The prof uses foo and bar too often in class. It is like being in a barn." would be output "The prof uses ***and*** too often in class. It is like being in a The 10 Write a Class called Censor. It should have a static method censor (File source, File destination, File badlist) that reads each line in badlist and then replaces any occurrence of a word (or words) specified on a line in badlist in the source file, putting the new text in the destination file. The replacement should consist of the same number of characters as the replaced text length. If should not match across linebreaks. You can (and should) use anything in the String class, anything related to regular expressions and your preferred File 10 from the java.10 package. You should code everything else on your own. Your submission should include an appropriate text chosen by you, no longer than 20k, an amusing badlist file and the resulting output in a third file. You should have a main method that uses the first two files to generate the third. Example: with badlist "foo", "bar" and input "The prof uses foo and bar too often in class. It is like being in a barn." would be output "The prof uses ***and*** too often in class. It is like being in a
Expert Answer:
Answer rating: 100% (QA)
import javautil import javaio public class Censor public static void censorFile source File destination File badlist throws IOException read each line ... View the full answer
Related Book For
Accounting Principles
ISBN: 978-0470534793
10th Edition
Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso
Posted Date:
Students also viewed these computer network questions
-
The following is taken from the Sinjh Corporation balance sheet. SINJH CORPORATION Balance Sheet (partial) December 31, 2015 Current liabilities Interest payable (for 12 months from January 1 to...
-
A pair of points is given. (0, 8), (3, 0) (b) Find the distance between them. (c) Find the midpoint of the segment that joins them. (x, y) = ------- Find an equation of the circle that satisfies the...
-
The following is an alphabetical listing of Stone Boat Companys balance sheet accounts and account balances on December 31, 2016: Additional information : 1. The company reports on the balance sheet...
-
If a large chilled water plant has 6 chillers and 5 of them are operating at 1 0 0 % , when the operator starts the 6 th chiller, to what percent do the first 5 chillers unload? What formula do you...
-
Chance (Summer 2004) published an article on the use of lead bullets as forensic evidence in a federal criminal case. Typically, the Federal Bureau of Investigation (FBI) will use a laboratory method...
-
On January 1, 2022, Lund SA issued 10-year, 3,000,000 face value, 6% bonds, at par. Each 1,000 bond is convertible into 15 ordinary shares of Lund. Lunds net income in 2023 was 240,000, and its tax...
-
A credit default swap requires a premium of 70 basis points per year paid semiannually. The principal is \($350\) million and the credit default swap is settled in cash. A default occurs after five...
-
Peyton Company's payroll for the year is $737,910. Of this amount, $472,120 is for wages paid in excess of $7,000 to each individual employee. The SUTA rate in Peyton Company's state is 2.9% on the...
-
Find the vertex, axis of symmetry, x and y-intercepts, and sketch the parabola. 5). 3x=y2 (Solve for x.) Opens left or right? axis of symmetry:. vertex: x-intercept: y-intercepts:
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
Research Gafner v. Down East Community Hospital case study and: describe (a) the corporate theory of liability; (b) its purported justification; and (c) the basis of criticism against it.
-
From the following Trial Balance of M/s Sameer & Co., Bhopal, prepare a Trading and Profit & Loss Account for the year ending 31st March 2019 and also a Balance Sheet as on the date: Particulars...
-
With a quick ratio of 2.00x, cash on hand of $33,525, and accounts receivable of $18,625 as well as some inventory, Alfred Inc. has $74,500 in total current assets and $26,075 in total current...
-
Eldrich Real Estate Appraisal Adjusted Trial Balance June 30, 2016 Account Title Cash Accounts Receivable Office Supplies Prepaid Insurance Building Accumulated Depreciation-Building Land Accounts...
-
In 2 0 2 2 , Vanessa purchased a new computer ( 5 - year property ) for her consulting gig. She spent $ 8 0 0 on the computer. If she maximizes bonus depreciation, how much can she deduct? $ 1 6 0...
-
In the circuit depicted below, there is a battery with an emf of 37.0 V with negligible internal resistance. Resistor R1 is equal to 10.0 2 and the current through R1 is 2.5 A. The current through R3...
-
Temple City California Comprehensive Pan How does it Work? What purpose does it serve? What are the effects and second-order consequences? Describe the necessary primary stakeholders to have a...
-
It is possible to investigate the thermo chemical properties of hydrocarbons with molecular modeling methods. (a) Use electronic structure software to predict cHo values for the alkanes methane...
-
Jordan Company uses budgets in controlling costs. The May 2012 budget report for the company??s Packaging Department is as follows. The monthly budget amounts in the report were based on an expected...
-
For the year ended December 31, 2012, the job cost sheets of Heimer Company contained the following data. Other data: 1. Raw materials inventory totaled $15,000 on January 1. During the year,...
-
Information related to Gustavo Company for 2012 is summarized below. Total credit sales $1,100,000 Accounts receivable at December 31 369,000 Bad debts written off 22,150 Instructions (a) What amount...
-
Nestls financial statements are presented in Appendix B. Financial statements of Delfi Limited are presented in Appendix C. Instructions Refer to the financial statements and answer the following...
-
Writing Financial statement information about four different companies is as follows. Instructions a. Determine the missing amounts. (Hint: For example, to solve for (a), Assets Liabilities = Equity...
-
The financial statements of TSMC are presented in Appendix A. The complete annual report, including the notes to the financial statements, is available at the companys website. Instructions Refer to...
Study smarter with the SolutionInn App