Menu

—create a function that will input the keywords from the keyword text document into an array

—create a function that will input the keywords from the keyword text document into an array

—create a function that will scan the resume text document word by word while comparing and counting the number of times the resume word matched the keyword (Basically if only 5 keywords popped up in the entire resume the score of the resume should reflect 5%)

My solution:

**Please assume these files exist***

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
FILE *keywordFile;
char keywords[100][100];

keywordFile = fopen(“keywordFile.txt”, “r”);
if (keywordFile == NULL) {
printf(“Unfortuntely, we encountered an issue when trying to access your file. Please contact tech support to solve your issue. The program will be exiting briefly”);
exit(-1);
}

int line = 0;
while (!feof(keywordFile) && !ferror(keywordFile)) {
if (fgets(keywords[line], 100, keywordFile) != NULL) {
char *s = strtok(keywords[line], “,”);
line++;
}
}
fclose(keywordFile);

FILE * res;
int c;
int count = 0;
char skills[100];
res = fopen(“resume.txt”, “r” );
while(!feof(res)){
c = fgetc(res);
if(c == ‘,’){
break;
}
skills[count] = c;
printf(“%c”, skills[count]);
count ++;}
printf(“%d”, count);

fclose(res);
return 0;

}

Expert Answer

Step 1/1
a suggestion for

OR