Count the amount of words in the file a word can end with a


1.     For all assignments, always use comments to explain your program.

2.      You must use the names given to name your program. 

Objectives:

1.     To gain experience with string objects.

2.     To gain experience with generic algorithms.

3.     To gain experience with files - opening for input and output.

Documentation:

1.     Explain the purpose of the program as detail as possible

2.     Develop a solution for the problem and mention algorithms to be used

3.     List data structures to be used in solution.

4.     Give a description of how to use the program and expected input/output

5.     Explain the purpose of each class you develop in the program.

Programming:

1.     For each method, give the pre and post conditions and invariant, if any

2.     Program execution according to the requirements given 

3.     Naming of program as required

4.     Print out of source code

Description of program:

You are to write a program name wordcount.java that prompt the user for a user input file name, reads the input words and do the following with those words:

1.     Count the amount of words in the file. A word can end with a --- space, EOLN character or a punctuation mark (which will be part of the word).

2.     Count the amount of lines in the file.

3.     Count the amount of alphanumeric characters in the file.

4.     Count the number of sentences in the file.

5.     Count the amount of vowels in the file - only a, e, i, o, u are vowels.(This includes upper case also...A, E, I, O, U)

6.     Count the amount of punctuations in the file.

You must output the above information both on the screen as well as an output file name "output.txt".

Here are some requirements for the program:

The program must work even if the input file is empty. If this is the case print a message saying that "the input file is empty" and then terminate the program.

Implementation:

Use as many generic algorithms as possible so that the size of the program can be reduced.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Count the amount of words in the file a word can end with a
Reference No:- TGS0651484

Now Priced at $40 (50% Discount)

Recommended (92%)

Rated (4.4/5)