I need help on writing a program, this was the breif:

"Write a program to count the number of characters and lines in a text file. In addition, determine the percentage of characters of the following classes: digit, upper-case letters and lower case letters, angled and curly bracket.

Create a test file with some (at least 7) lines of text, containing different mixes of characters and digits to test the program.

Prompt the user for the filename and store the results in a different file. The results should be stored in a neat and easy to read format, with a proper heading including the name of the file tested"

I can write programs to count the number of characters in a string and I can write a program that will open a file. What I cant do is to put these two together in any useable way. Any help on the problem, would be much appreciated.

Thanks