CS 239
Advanced Programming
Lab239-03: Parsing a String
If you look at a word processing application such as Word, it has the ability to count various features of the document, such as number of words and number of characters. This application will let you explore how they might have done that. Bring a copy of your program to class tomorrow in either hardcopy form or electronically.
This application will be written from scratch.
Part 1 - The application
Write a program that prompts the user for a phrase. Using methods from the String and StringTokenizer classes, report back:
Within your code, you should:
Your "main" method should be relatively bare. I would suggest that, to save time when testing, it include a loop to repeatedly ask the user for input.
From here, you should call other methods in (an)other class(es) to handle the tasks to be done.
A brief overview of the StringTokenizer class is available here A short program showing some of the methods of the class is available here .
When you are finished, bundle your file(s) into a zip file. You can do this from the command line in Linux in the form:
zip < name of zip file > [List of files to include - wildcards can be used here]
The name of the zip file should combine the lab number and the last names of each member of the pair (or a single last name if solo). For example:
zip Lab3NortonHarris.zip *.java
This will create a file called "Lab3NortonHarris.zip" that includes all file(s) that end with .java in the current directory). Submit the zip file to Blackboard BEFORE the beginning of class on Monday.