Write a program named MidtermAnalysis to analyze data in a text file. In MidtermAnalysis, you should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program named MidtermAnalysis to analyze data in a text file. In MidtermAnalysis, you should have the following methods: public void read(String filename) throws FileNotFound Exception public void report() throws FileNotFoundException The parameter in the read() is the filename that you want to read. You should create a text file named "data.txt" in this question which contains the sentence as shown in Figure 2. You should then count the number of words in the sentence and find the longest word in the sentence. The report() method is to write the result of analysis to another text file named "Result.txt". You should write the number of words and the longest word in the sentence when you call the report() method. This is midterm test for Data Structure and Software Design. Figure 2 Write a program named MidtermAnalysis to analyze data in a text file. In MidtermAnalysis, you should have the following methods: public void read(String filename) throws FileNotFound Exception public void report() throws FileNotFoundException The parameter in the read() is the filename that you want to read. You should create a text file named "data.txt" in this question which contains the sentence as shown in Figure 2. You should then count the number of words in the sentence and find the longest word in the sentence. The report() method is to write the result of analysis to another text file named "Result.txt". You should write the number of words and the longest word in the sentence when you call the report() method. This is midterm test for Data Structure and Software Design. Figure 2
Expert Answer:
Answer rating: 100% (QA)
The simple java program that fulfills the requirements you mentioned import javaioFile import javaio... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
In this programming assignment you will practice using ArrayLists, Inheritance and Polymorphism. You are to write a game called Magical Creatures War. You will do this by implementing a class called...
-
Organizational buyers are ________.
-
Compare and contrast the primary differences between the job costing and process costing using the following table: Job costing Process costing Most suitable manufacturing environment Cost object...
-
How do question answering systems work?
-
Barbara Vigil, Chief Justice, New Mexico Supreme Court Ken Badilla bought a pair of Brahma brand work boots from Wal-Mart on October 19, 2003. The boots packaging had these express descriptions: iron...
-
Laroche Landscaping has collected the following data for the December 31 adjusting entries: a. Each Friday, Laroche pays employees for the current weeks work. The amount of the weekly payroll is...
-
One of the biggest impacts of ___________ is the requirement for companies and their auditors to provide reports about the effectiveness of internal controls over the financial reporting process....
-
Make a list of assumptions that will be used as the basis for planning the wedding. And no, it is not acceptable to assume that Tony and Peggy Sue will just elope, no matter how tempting that may be!...
-
Note at least one possible audit procedure you would perform to test the control; and a financial statement assertion, if any, related to your objective/audit procedure. Where there is no control,...
-
An analyst gathered the following information for a stock and market parameters: stock beta = 1.5; expected return on the Market = 9.4%; expected return on T-bills = 0.61%; and current stock Price =...
-
If instead of borrowing pounds, I borrow $7.5 million, and then convert first into euro, then into pound, and then back into dollar, what will be my profit/loss (ignoring commissions)? If instead,...
-
A written explanation is needed for the following problem. Predict the outcome of each line: I = 1 j = 0 while I < 10: I + = 1 j + = 2 * 2 print (i) #line 1 print (j) #line 2
-
How do cells maintain protein homeostasis through processes such as protein folding, quality control, and degradation via the ubiquitin-proteasome system and autophagy, and what are the implications...
-
Missouri Office Products (MOP) produces three different paper products at its Vaasa lumber plant: Supreme, Deluxe, and Regular. Each product has its own dedicated production line at the plant. It...
-
In the late 1970s, Britain seemed to have struck it rich. Having developed its North Sea oil-producing fields in earlier years, Britain suddenly found its real income higher as a result of a dramatic...
-
Decades after the event, Johnson & Johnson (J&J), the 130-year-old American multinational, is still praised for swiftly The company indicated that its response was based on the expectations set forth...
-
Sometimes we would like a class that has just a single unique instance. Create a class Merlin that has one attribute, theWizard, which is static and of type Merlin. The class has only one constructor...
-
Write a static method removeDuplicates(Character[] in) that returns a new array of the characters in the given array, but without any duplicate characters. Always keep the first copy of the character...
-
Repeat Exercise 13, but use a multibranch if-else statement instead of a switch statement. Exercise 13 Imagine a program that displays a menu of five possible choices, lettered a through e. Suppose...
-
True or false? Economic theory argues that discrimination should be eliminated. Why?
-
Why is discrimination based on characteristics that affect job performance difficult to eliminate?
-
Visit the Suzy Lamplugh Trust website at http://www.suzylamplugh.org and the Social Research Association at http://the-sra.org.uk/sra_resources/safety-code/ . Browse the guidance leaflets/web pages...
Study smarter with the SolutionInn App