How to do this problem ?

  • Thread starter sunny86
  • Start date
  • #1
How to do this problem ??

Write a complete C program that can be used as a text file analyser. The analyser program should be able to combine two text files and provide the statistics of the following items in a text file: number of alphabetical letters (A to Z and a to z), characters (without spaces), characters (with spaces), words, lines of text, and paragraphs. The text files (e.g. filename.txt, filename.c or filename.dat created using MS DOS Editor or MS Notepad) should contain English words, and each paragraph is separated by a blank line.

When the program is run, the user is prompted to select an option from a menu as shown below:
1. Merging two text files
2. Obtain the statistics of a text file

If option 1 is selected, then the following prompts appear:

Enter the names of the two files to be merged: filename1.txt filename2.txt
Enter the name of the merged file: filename3.txt

If option 2 is selected, then the following prompt appears:

Enter the name of the file to be analysed: filename3.txt

An example output of the option 2 is as below:

Alphabetical letters 100
Characters (without spaces) 120
Characters (with spaces) 200
Words 30
Lines of text 5
Paragraphs 2

Answers and Replies

  • #2
Staff Emeritus
Do you expect us to flat out give you the code? Where is your attempt at the problem?