In order for you to show us that you can do simple java programming, you are only allowed to use the following built-in java classes:
In this warm-up project, you will write a java program that reads from a file. The first line of the file is an integer, it tells you how many types of strings in this file. Each of the other lines of the file is a string, which only contains lower case letters from a to z. Your program counts the strings and sorts the strings as required by the command line arguments. Following is a sample of how the file, sample.txt, looks like:
Your java program implements the class CountString. It accepts two arguments from the command line: file name and printing format. The printing format is an integer of 0, 1, or 2.
The following shows how your program responds to the command line inputs:
% java CountString sample.txt 0 smile 5 confused 6 sad 1 % java CountString sample.txt 1 confused 6 smile 5 sad 1 % java CountString sample.txt 2 confused 6 sad 1 smile 5
Please read the file format for your program.