Computer Science 252
Problem Solving with Java

Fall 2015, The College of Saint Rose

Lecture 24: Matrices; Strings and Characters
Date: Thursday, December 3, 2015


Agenda

Lecture 24 Assignment

Due at the start of class, Tuesday, December 8.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to terescoj AT strose.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CSC 252 Lecture 24 Assignment , Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted.

(20 points) Write a Java application in a class WordStats that takes the name of a text file as its command-line parameter, then reads all of the words in that file. It should ignore any word that contains a non-alphabetic character, but consider all other words to compute the information below. Your program should report to standard output (the terminal window) the following information:

Include simple error checking to ensure that the command-line parameter exists, and that the file was successfully opened.

Terminology

Examples