NOTE: This assignment identifies what you need to do along with some guidelines,
but is quite a bit less prescriptive then previous assignments.
Do all of your work in the provided hw08 directory in your homework
Your final program should:
- Accept the name of a file as a command-line parameter. The input file
should be assumed to have a series of individual words with one word per
- If there is no command-line parameter (or more than one) the program
should exit with an appropriate error message.
- For each word determine whether or not the word is a palindrome and
display these statistics when complete: total number of words read, total
number of palindromes, percentage of words that palindromes compose, the
amount of time elapsed to read the file and determine the required values.
- The timing of code should make used of a CodeTimer class. You can
write your own or use the one that appears in various examples.
- The reading of the data file should use a BufferedReader rather
- Your solution should attempt an object-oriented design. NOTE: My design
used a single class in addition to main() and I passed the data file
name to the constructor as a parameter. I kept the method from the in-lab
assignment as a static method in my class.
- The code that houses main() should be in a file named
- As always use JavaDoc notation for commenting classes and methods and
follow Java programming conventions.
For fun you might try to find a large text file that contains a bunch of words
(one per line) and see what the statistics look like.
As you work, document your code and commit at appropriate times. When
you complete your work be sure to push all committed changes to bitbucket.
In the data directory of the homework repository I provided a sample
input file named smallwords.txt. This is the output of my program
when run using that file as input:
Input File : ../data/smallwords.txt
Words Processed: 13
# Palindromes : 4
% Palindromes : 30.769%
Time Elapsed : 0.000
NOTE: When grading I will test your program using a different data file.
The assignment will be graded according to the following criteria:
Your program should be completely working and should follow all of the
programming conventions named in class and explained in
http://josephus.hsutx.edu/classes/all/javaconventions/ (including the use
of comments that conform to the JavaDoc guidelines).
The instructor will grade your work based on what you have pushed to the hosted
homework repository you have shared. For all assignments the program is due
before the beginning of class on the due date. Repositories that show a commit
time after that time will be graded as late.