Which of the following best describes what the following code accomplishes? Buffered Reader reader = new...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Which of the following best describes what the following code accomplishes? Buffered Reader reader = new Buffered Reader(new FileReader("in.txt")); Print Writer writer = new PrintWriter(new Buffered Writer(new FileWriter("out.txt"))); String inLine = reader.readLine(); while (inLine != null) { String outLine = ""; } for (int index = 0; index < inLine.length(); index++) { char c = inLine.charAt(index); if (c == "") { } outLine += '*'; } else { outLine += c; writer.println(outLine); inLine = reader.readLine(); reader.close(); writer.close(); It converts the input file 'in.txt' to a binary file. It copies the content from 'in.txt' to 'out.txt' one character at a time. It counts the number of commas in the input file and prints a tally (using stars) to the output file. It replaces all commas in the input file with stars and writes the result to the output file. Which of the following best describes what the following code accomplishes? Buffered Reader reader = new Buffered Reader(new FileReader("in.txt")); Print Writer writer = new PrintWriter(new Buffered Writer(new FileWriter("out.txt"))); String inLine = reader.readLine(); while (inLine != null) { String outLine = ""; } for (int index = 0; index < inLine.length(); index++) { char c = inLine.charAt(index); if (c == "") { } outLine += '*'; } else { outLine += c; writer.println(outLine); inLine = reader.readLine(); reader.close(); writer.close(); It converts the input file 'in.txt' to a binary file. It copies the content from 'in.txt' to 'out.txt' one character at a time. It counts the number of commas in the input file and prints a tally (using stars) to the output file. It replaces all commas in the input file with stars and writes the result to the output file.
Expert Answer:
Answer rating: 100% (QA)
The detailed answer for the above question is provided below Answer The correct description for ... View the full answer
Related Book For
Auditing and Assurance Services
ISBN: 978-0077862343
6th edition
Authors: Timothy Louwers, Robert Ramsay, David Sinason, Jerry Straws
Posted Date:
Students also viewed these programming questions
-
What problems, if any, are visible in the control charts in Figure 18.5.6? What action (if any) would you suggest? FIGURE 18.5.6 5 0 5 0 sebuey 0 5 0 5 0
-
a) Bridge Architects Ltd (Bridge) is a firm of architects based in Sydney. It specialises in high level modelling and drawing that is used for blueprint purposes for a variety of structures. To...
-
Complete the table 42. Operating Profit Margin, Asset Turnover, ROI, and RI (Note: All dollar amounts are in thousands as presented in the textbook.) a. Web Division IT Division Ending Beginning...
-
Peppers Lockdown produces keys for homes and cars. As Peppers is planning for next year's production, he decided to implement a high-low system to forecast future costs. With total production of...
-
The dual cycle of Fig. 9.41 has a compression ratio of 20, a cutoff ratio of 3, and a pressure ratio of 2. Calculate its thermal efficiency, the heat input, and the net work output if the inlet...
-
Compare and contrast pilot conversion, phased conversion, and simultaneous conversion.
-
Identify all the integers in the following list: \(4,-17,8,0.5, \sqrt{7}, \frac{1}{9},-300\).
-
Each of the following items must be considered in preparing a statement of cash flows (indirect method) for Turbulent Indigo Inc. for the year ended December 31, 2014. a) Plant assets that had cost...
-
. U.S. Dollar-British Pound. Assuming the same initial values for the U.S. dollar-British pound cross-rate in this table , how much more would a call option on pounds be if the maturity was doubled...
-
1. Marketing analysts use market position maps to display visually the customers perceptions of a firm in relation to its competitors regarding two attributes. Prepare a market position map for Alamo...
-
Figure 1 shows a social network of users as nodes that are connected by friendship edges. It is important to analyze the community structures of social networks. (a) A strongly connected component...
-
What is the per capita GDP for the U.S. and Australia and does it make more sense to use the per capita GDP measure as a comparison measure? Using Link:...
-
Dr. Jennings sent the following memo to Dr. Wilson, the Nalukai School District superintendent, regarding their analysis of current budgeting practices in the school district. Dr. Jennings...
-
Due to the breaches above your workplace has identified the need for a formal Code of Conduct to clearly outline the expected behaviours in the workplace. The owner has asked you to develop a Code of...
-
This specific discussion will center around the evils of every economy. Locate an article about one of these topics. Topics: inflation and unemployment You may not use anything from social media. My...
-
Resources Cost Laptops 350,000 Tablets 100,000 Printers 50,000 using all the resources needed by client to purchase, using Excel to compute the cost for a cash payment b. installment for 6 months...
-
Case Study: Navigating Challenges in Accounting Auditing Errors ABC Corporation, a multinational company, recently underwent an annual audit conducted by an external auditing firm. Despite the...
-
Phosgene, COCl2, is a toxic gas used in the manufacture of urethane plastics. The gas dissociates at high temperature. At 400oC, the equilibrium constant Kc is 8.05 104. Find the percentage of...
-
Which of the following would not be considered confidential information obtained in the course of an engagement for which the clients consent would be needed for disclosure? a. Information about...
-
Why are general controls so important in the audit teams evaluation of internal control and assessment of control risk and risk of material misstatement?
-
Auditors are interested in having independence in appearance because a. They want to impress the public with their independence in fact. b. They want the public at large to have confidence in the...
-
The annual salaries for web software development managers are normally distributed, with a mean of about \($136,000\) and a standard deviation of about \($11,500\). Random samples of 40 are drawn...
-
The scores on the SAT French Subject Test for the 2018 2020 graduating classes are normally distributed, with a mean of 603 and a standard deviation of 111. Random samples of size 16 are drawn from...
-
From 1921 through 2020, the mean return of the Standard \& Poor's 500 was \(12.59 \%\). A random sample of 38 years is selected from this population. What is the probability that the mean return for...
Study smarter with the SolutionInn App