Krzysztof Mossakowski
Advanced Windows Programming
2004 - Tasks
.NET Framework, Console Application
Version C
Statistics of text files
Functionality:
Get the name of directory with files (the 1st parameter from command line)
Get the mask of files (e.g. *.txt) (the 2nd parameter)
Get the name of output file (the 3rd parameter)
For each file from the directory or from any of its subdirectory with name matching the mask:
Count total number of words
Count number of words beginning with latin letters (one counter per letter, case-insensitive)
For each file write to output file the name, total number of words and latin letters sorted descending by value of their counters
Technical requirements:
Catch all exceptions
Hints:
DirectoryInfo
StreamReader, StreamWriter
string.Split()
Approximate points:
command line arguments: 1.0
reading files from directory: 3.0
checking all subdirectories: 1.0
counting number of words in a file: 1.5
counting words for letters: 1.5
sorting letters: 1.0
writing information to output file: 1.0