How to do this problem ?

  • Thread starter sunny86
  • Start date
  • #1
sunny86
10
0
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:
Menu
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:

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

Answers and Replies

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

Suggested for: How to do this problem ?

  • Last Post
Replies
10
Views
546
Replies
7
Views
543
Replies
6
Views
465
  • Last Post
Replies
26
Views
667
Replies
13
Views
726
Replies
5
Views
136
Replies
26
Views
885
Replies
4
Views
371
Replies
5
Views
330
Top