For my c program, it has to be able to look for words in a dictionary. I'm not that great of a programmer but I have been doing my research and have puts bits and pieces together from my understanding. Is my C program written to where it would compile correctly and abide by the properties below?
-The longest word(s) typed with only the right hand.
-The longest word(s) typed with only the left hand.
-The longest word(s) typed with only the first row of the keyboard.
-The longest word(s) typed with only the second row of the keyboard.
-The longest word(s) typed with only the third row of the keyboard.
-All words and longest word ending in ‘dous.’
-All palindromes.
-All words and longest word having all five vowels in order.
-The percentage of time the left hand is used to type all dictionary words in
order
*** EDIT ***
Please use code tags when posting code
-The longest word(s) typed with only the right hand.
-The longest word(s) typed with only the left hand.
-The longest word(s) typed with only the first row of the keyboard.
-The longest word(s) typed with only the second row of the keyboard.
-The longest word(s) typed with only the third row of the keyboard.
-All words and longest word ending in ‘dous.’
-All palindromes.
-All words and longest word having all five vowels in order.
-The percentage of time the left hand is used to type all dictionary words in
order
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char data [20] char a[5][20]; int mcount struct node * Link; }; struct node * dic[26]; /* printf("Enter the name of the file that want to be check: \n"); scanf("%s", &inputfile); printf("Enter the name of the corrected file: \n"); scanf("%s", &outputfile); printf("Enter a word that need to be changed: \n"); scanf("%s", &chword); printf("Enter the word to replace the word above: \n"); scanf("%s", &reword); */ //process each word in ifile while (!feof(ifile)){ fgets(token, 256, ifile); int found = 0; int len; len = strlen(token); char word[256]; char beginpunct[2]; char endpunct[10]; int value; int i; printf("length = %d\n", len); //disects word with punctuation into a plain word that would be in the dictionary for (i = 0; i < len; i++){ value = atoi(&(token[i])); // printf("%d", value); if (value >= 97 || value <= 122){ strcat(word, &(token[i])); } else if (value >= 65 || value <= 90){ strcat(word, &(token[i])); } else{ if(i == 0){ strcpy(beginpunct, &(token[i])); } else{ strcat(endpunct, &(token[i])); } } } //process each word with dictionary while (fscanf(linuxdict, "%s", dictword) !=EOF){ if (strcasecmp(word, dictword) == 0){ found = 1; break; } } fseek(linuxdict, 0, SEEK_SET); if (found == 0){ printf("%s \n", word); } // fprintf(ofile, "%s ", word); } return 0; }
*** EDIT ***
Please use code tags when posting code
