Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The simple java program that fulfills the requirements you mentioned import javaioFile import javaio...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started