Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads a text file and reports the totalcount of words of ea

ID: 3658041 • Letter: W

Question

Write a program that reads a text file and reports the totalcount of words of each length. A word is defined as any contiguous set of alphanumeric characters,including symbols. For example, in the cuurrent sentence there are 12words. The file should be given at the command line as anargument. (1)The file should be read one word at a time. (2) A count should be kept for how many words have agiven length. For example, the word "frog" is 4 bytes in length; the word"turtle" is 6 bytes in length. (3)The program should report total word counts of all lengthsbetween 3 and 15 bytes. Words with lengths outside that rangeshould not be counted. This needs to be written in C/Unix

Explanation / Answer

/*you may also download my code from.....http://www.2shared.com/file/ljncHu4h/FILE5.html*/ /*this is compppiled with BORLAND compiler*/ #include#include void main() { FILE *fp; char word[40]; int length; int count=0; clrscr(); fp=fopen("word.txt","r"); fscanf(fp,"%s",&word); printf(" %s",word); length=strlen(word); if(length>=3 && length=3 && length
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote