Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to do this problem ?

  1. Sep 6, 2005 #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:
    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
     
  2. jcsd
  3. Sep 6, 2005 #2

    dduardo

    User Avatar
    Staff Emeritus

    Do you expect us to flat out give you the code? Where is your attempt at the problem?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: How to do this problem ?
  1. How do use this? (Replies: 1)

  2. How do i type in (Replies: 2)

  3. How do they do it? (Replies: 2)

  4. How do i ? (Replies: 9)

Loading...