Need help with Java application.

timer Asked: Oct 1st, 2015

Question description

Create a java application to count the number of words, lines, and occurrences of some specific words from a given text. Read the file Iliad.txt into a program and calculate (count) the number of words and lines that occur in the text. Additionally, calculate (count) the number of times that each of the following names occur in the text: 





Display all of these counts to the user. Here is an example of how the program output might appear: 

This file(Iliad.txt) had 19000 lines and 139894 words. 

Achilles's name appears 383 times. 

Agamemnon's name appears 152 times. 

Hector's name appears 447 times. 

Helen's name appears 57 times.

# Checkpoints:

Correct Style - comments 

Using the File object with Iliad.txt file 

Testing for file existence and display error message if file not found 

Process only if file found 

Proper use of a try catch block 

Using Scanners to read each line and word 

Closes the file 

Tutor Answer

(Top Tutor) Studypool Tutor
School: UCLA
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors