Question

Most larger companies have software programs that scan through submitted resumes and select the best resumes...

Most larger companies have software programs that scan through submitted resumes and select the best resumes as possible interview clients.

The program will assume that there is a text file representing an applicant’s resume as a text file. The resume text document needs to be placed in the SRC folder of the project. You will make this document up.

You will create another separate text file which will also be placed in the SRC folder. This file will contain a bunch of keywords separated by commas. No keyword will contain a comma. You are to count the total times the keywords are found in the fake resume.

Your program will simply output to the screen the count of keywords with in the document that match the keywords.

In real life the higher the number the higher the chance that the person (the owner of the resume) will get an interview.

Submission Requirements:

Requirements will be same as the first assignment which will be the same for all future assignments. Remember you are to also include the two required text files (resume and keywords).

YOU CANNOT

  • Use global variables, in this or any program ever.

  • Use goto statement(s) , in this or any program ever.


C programming please.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ResumeFilter.c

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

/**
* Returns total occurrences of a word in given file.
*/
int countOccurrences(FILE *fptr, const char *word)
{
char str[1000];
char *pos;

int index, count;
  
count = 0;

// Read line from file till end of file.
while ((fgets(str, 1000, fptr)) != NULL)
{
index = 0;

// Find next occurrence of word in str
while ((pos = strstr(str + index, word)) != NULL)
{
// Index of word in str is
// Memory address of pos - memory
// address of str.
index = (pos - str) + 1;

count++;
}
}

return count;
}

int main()
{
int totalCount = 0;

char str[1000];
char *ptr;
char *words[1000];
FILE * fp = fopen("bravo.txt", "r");
FILE * f = fopen("resume.txt", "r");

fgets(str, 1000, fp);
ptr = strtok(str, ", "); // split our findings around the " "
int count = 0, i = 0;
while(ptr != NULL) // while there's more to the string
{
words[count]= ptr;
count++;
ptr = strtok(NULL, ", "); // and keep splitting
}
fclose(fp);

for(i=0; i < count; i++){
  
totalCount += countOccurrences(f, words[i]);
}

  

printf("The keywords appeared %d times in the resume", totalCount);

fclose(f);

return 0;
}

output:

The keywords appeared 3 times in the resume

Add a comment
Know the answer?
Add Answer to:
Most larger companies have software programs that scan through submitted resumes and select the best resumes...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Overview: file you have to complete is WordTree.h, WordTree.cpp, main.cpp Write a program in C++ that...

    Overview: file you have to complete is WordTree.h, WordTree.cpp, main.cpp Write a program in C++ that reads an input text file and counts the occurrence of individual words in the file. You will see a binary tree to keep track of words and their counts. Project description: The program should open and read an input file (named input.txt) in turn, and build a binary search tree of the words and their counts. The words will be stored in alphabetical order...

  • Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance...

    Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance and interface behaviors . The link to the PDF of the diagram is below MotorVehical.pdf Minimize File Preview User Define Object Assignment: Create a Intellij Project. The Intellij project will contain three user defined classes. The project will test two of the User Define Classes by using the invoking each of their methods and printing the results. You are required to create three UML...

  • Assignment 4 Real Deal: Crier On Us Some word games, like Scrabble, require rearranging a combination of letters to make...

    Assignment 4 Real Deal: Crier On Us Some word games, like Scrabble, require rearranging a combination of letters to make a word. This type of arrangement is generally referred to as an anagram, it's known as a permutation in mathematics. This assignment will give you some experience thinking about and writing recursive functions. Write a C++ program that searches for ``anagrams'' in a dictionary. An anagram is a word obtained by scrambling the letters of some string. For example, the...

  • Tokeniser in C++

    TokenisersBackgroundThe primary task of any language translator is to work out how the structure and meaning of an input in a given language so that an appropriate translation can be output in another language. If you think of this in terms of a natural language such as English. When you attempt to read a sentence you do not spend your time worrying about what characters there are, how much space is between the letters or where lines are broken. What...

  • Have you ever wanted to predict the future? Well the Magic Eight Ball does just that....

    Have you ever wanted to predict the future? Well the Magic Eight Ball does just that. The original game was a softball sized “8-ball”. You would ask a question, shake it up and look at the result. There are 20 responses…10 positive, 5 negative, and 5 are vague. For this project, we want to recreate this, but give the ability to read in a set of responses, and add additional responses, and print out all of the responses in alphabetical...

  • CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program...

    CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program will play music from a text file. Objectives Working with lists Background This project addresses playing music. A song consists of notes, each of which has a length (duration) and pitch. The pitch of a note is described with a letter ranging from A to G.   7 notes is not enough to play very interesting music, so there are multiple octaves; after we reach...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT