Question: Java SpeechReader.java You have been hired by some historians to perform an analysis of past presidential speeches. The group seeks to understand how the words

Java

SpeechReader.java

You have been hired by some historians to perform an analysis of past presidential speeches. The group seeks to understand how the words used in political speeches have changed over time. They would like you to analyze a set of inauguration addresses made by US presidents and calculate the average length of each word in a speech, as well as the total number of words. Write a program which reads through a speech stored in a text file (examples provided below) and calculate this information. Print the results to the screen. Assume that the first line of each file is the name of the president who gave the speech and the second line is the date of the speech. Print this information along with your output, but do not include it in your calculations.

There are many ways to do this. You could use a for loop and the charAt() method in the String class to find each word. Or you could use the split() function inside the string class to take a line and get back an array with each word.

Inaugural addresses from some of our great (or perhaps not so great) presidents:

Thomas Jefferson

William Taft

Millard Fillmore

John F. Kennedy

George W. Bush

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!