DATA STRUCTURES for JOB HUNT

Discussion in 'C' started by lath, Dec 10, 2011.

  1. lath

    lath New Member

    Joined:
    Dec 10, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey ppl I am wirting a code for job hunt and need ur help."here is the problem desciption:a job consulting firm recruits applicants to various job positions in different companies based on the percentage of marks scored by the applicants and the positions to which the yapply.
    you have to develop a program to process a file containing the job requirements data and applicants data and place the applicants in various companies.
    input format
    the input contains;
    number of companies,number of job positions.2.for each position in a company,
    a.company number
    b.position number'c.minimum cut off for the position
    3.number of applicants
    a.name
    b.% marks
    5
    company names to whihc applicant is applying
    6.
    job position to which applicant is applying.
    please help me get this program solved.
     
  2. hobbyist

    hobbyist New Member

    Joined:
    Jan 7, 2012
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    0
    the more info you provide (as well as the code you've tried), the more likelihood you'll get a response. I'd think you'd want/need a structure or two...

    post a sample of the input file.
     
  3. Avinash5782

    Avinash5782 New Member

    Joined:
    Feb 6, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi lath,

    you got any solution ?


    Thanks in advance....
     
  4. Avinash5782

    Avinash5782 New Member

    Joined:
    Feb 6, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    HI hobbyist ,

    I need a solution for the given problem .. Can any one help me..


    A job consulting firm recruits applicants to various job positions in different companies based on the percentage of marks scored by the applicants and the positions to which they apply.

    You have to develop a program to process a file containing the job requirements data and applicants data and place the applicants in various companies.
    Input Format
    The input contains;
    1. Number of companies, Number of job positions, b
    2. For each position in a company,
    a. Company number
    b. Position no
    c. Minimum cutoff for the position
    3. Number of Applicants
    4. For each applicant
    a. Name (Word without spaces)
    b. %marks

    Constraints
    • The applicants need not be considered if the minimum cutoff for the applied job position is not met (equal to cutoff percentage means eligible for selection)
    • There would be a max of 1000 companies, and 100 positions in each company.
    • Max number of applicants is 100000.
    • Placements should be done in such was as to maximize the number of placements. If there are multiple such placements, you can output any one of them.
    • If there are multiple candidates who qualify for a position, the candidate with higest marks should be choosen.
    • If there is a contention between 2 candidates with the same marks for a position, the candidate whose name comes first in the input has to be placed.
    • If there is a contention between 2 positions, the position which appears first has to be filled first.


















    Sample Input
    2 4
    1 1 80
    1 2 70
    2 1 70
    2 2 80
    5
    SHARAT 90
    BIJU 75
    SUMA 75
    BABU 72
    TANAY 72
    Sample Output
    Company 1 Position 1 : SHARAT
    Company 1 Position 2 : BIJU
    Company 2 Position 1 : SUMA
    Company 2 Position 2 : Not filled
     
  5. hobbyist

    hobbyist New Member

    Joined:
    Jan 7, 2012
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    0
    Hello; have you tried using a linked list? maybe something like

    Code:
    struct company {
       char status[20]; // not filled or name of applicant
       int comp;        // company identifier
       int pos;         // position identifier
       int score;       // min value needed for position   
       struct company *next;  // node
    };
    
    struct applicant {
        char name[20];  // applicant's name
        int score;      // applicant's score
        int placed;     // identifier if applicant was placed or not
        struct applicant *next;
    };
    
    typedef struct company c_data;
    typedef struct applicant a_data;
    
    when you read the file, assuming it's a text file, you've got a couple of choices a) using fscanf, which will break on white space or b) fgets, which reads the entire line. If it were me, I'd use fgets and count lines in the file... assuming, the format is the same time each time.

    line == 0
    initialize company's list and store the max companies/positions into vars

    line < 5
    store data in company's list (according to criteria)

    line == 5
    initialize applicant's list

    line > 5
    store data in applicant's list (according to criteria)

    Not tested, but I *think* you can then create a couple of loops; the outer loop being the applicants and the inner loop being the company. compare the position for being "filled" along with the required score of the position with that of the applicant... if they're in agreement, modify the appropriate fields.

    HTH
     
  6. imported_Steve_

    imported_Steve_ New Member

    Joined:
    Feb 10, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.keepautomation.com
    Very nice forum of the C#. Will come back for more.

    Steve barcode
     
  7. gudaravi

    gudaravi New Member

    Joined:
    Jun 7, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    please please provide the answer I need urgently my mail id is madhanravi.g@gmail.com
     
  8. gudaravi

    gudaravi New Member

    Joined:
    Jun 7, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    please send solution madhanravi.g@gmail.com please
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice