This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Dont know what is this but its a programming Activity .. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Dont know what is this but its a programming Activity .." Watch "Dont know what is this but its a programming Activity .." New topic

Dont know what is this but its a programming Activity ..

kerwin john abrinica

Joined: Jan 15, 2012
Posts: 5
Hey guys .. need some help here

PROG 131 – Computer Programming II
Hands – on Exam Problem

Write a class named WordCount. This class contains a method wordCount that has a single String parameter, s. Assuming that s consists of words separated by whitespace, the method should return the number of words in s and the percentage of its use on the file. Words to be counted should be based on the words contained on the text file given. In comparing the words do not consider the case of the letters.

Sample words on the text file:
Testing can show the presence of errors, but not their absence.

Sample output of your program:

Word Count Report
Total number of words: 11
testing 1 0.09%
can 1 0.09%
show 1 0.09%
the 1 0.09%
presence 1 0.09%
of 1 0.09%
errors 1 0.09%
but 1 0.09%
not 1 0.09%
their 1 0.09%
absence 1 0.09%

• Display a word count report for each line in the given text file.
• The name of the input text file is wordCount_input.txt.
• Aside from displaying the word count report on the screen, write the output in a text file named wordCount_output.txt.
Tim Moores

Joined: Sep 21, 2011
Posts: 2409
Looks like an assignment you're supposed to do. What have you done so far? If you haven't started, what ideas have you had?
Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Note that this site is NotACodeMill (<= link). If you ShowSomeEffort (<= link), you'll get plenty of help. To simply do your homework for you, however, would be unethical and would rob you of the opportunity to learn.

Welcome to the Ranch, and good luck!
subject: Dont know what is this but its a programming Activity ..