Answered step by step
Verified Expert Solution
Link Copied!

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)

image

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Programming questions

Question

Organizational buyers are ________.

Answered: 1 week ago