Computer Science 252
Problem Solving with Java

Spring 2016, The College of Saint Rose

Lecture 24: Matrices; Strings and Characters
Date: Tuesday, April 26, 2016


Agenda

Lecture 24 Assignment

Due at the start of class, Tuesday, May 3.

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, Mary Smith). 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