Need it in 5-6 hrs from now..C programming..

profilejalnvemy
hw3_codestructure.txt

#include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> int numWords; int numUniqWords; struct wordStorage { char word[50]; int count; }; /* You can modify the functions to return objects instead of using void and pass by reference */ /* This is your choice and depends on how you wish to code it */ void decomposeToArray(char *para,char wordarr[1000][50]); void frequencyOfWords(struct wordStorage *wordarr,char wordList[1000][50]); void readFromFile(char *filename,char sentence[1000]);; void writeToFile(char *filename,struct wordStorage *wordarr); void displayWords(struct wordStorage *wordarr); /* This function is optional and you can use it to create a robust program that can read and write from any of the sources. You adjust the read and write values and according to some set values ( eg 0=>STDIO and 1=>FILE\) you call the required functions to process your input */ void executeCode(int read,int write,char readFile[100],char writeFile[100]); int main(int argc,char *argv[]) { int i,j; char readFile[100]; char writeFile[100]; int flag=0; // Checks for -h option. 1=FOUND , 0=NOT FOUND if(argc<=1) { // Fill code here when there are no options given i.e. the time when you read from STDIN and write to STDOUT } else if(argc>=2) { for(i=1;i<argc;i++) { if(strcmp(argv[i],"-h")==0) { printf("\nRead English Language text and calculate word frequencies.\n"); printf("\n\n"); printf("-h Display this help message.\n"); printf("-f file Read text from given file.\n"); printf("-o file Write program output to file.\n"); printf("-v Display version info and exit.\n"); flag=1; break; } } //Write code to link the functions and construct your program overall return 0; } void decomposeToArray(char *para,char wordarr[1000][50]) { // Fill your code here } void frequencyOfWords(struct wordStorage *wordarr,char wordList[1000][50]) { // Fill your code here } void readFromFile(char *filename,char sentence[1000]) { // Fill your code here } void writeToFile(char *filename,struct wordStorage *wordarr) { // Fill your code here } void displayWords(struct wordStorage *wordarr) { // Fill your code here }