CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Posts
    2

    Help with C programming

    You will read a rate table of medical codes and rates. You will request (prompt) an employee’s number, name, rate code and sex from the user. You must look up the employee’s rate code in the table and print out the meaning of the code. The employees must be print in employee number order. The output record should include the employee number, name, sex, rate code in words and the dollar amount. Also, at the end of the report, print out the total number of employees listed.

    Medical code table:
    Code 1 2 3 4
    Male Rates 25 30 40 50
    Female Rates 20 25 35 45

    Codes:
    1 – Employee only
    2 – Employee and one dependent
    3 – Employee and two dependents
    4 – Employee and three or more dependents

    Output Record
    Employee number Employee name Employee sex Rate in words Rate amount

    Total Number of Employees 9999

    Data validation: You must also include a check for invalid data conditions, and include checking for invalid conditions in your desk check.
    ------------------------------------------------------------------------------------
    Anybody have idea how to program it in C program
    Thanks

  2. #2
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    2,236
    i have an idea.

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Help with C programming

    Originally posted by calworld
    You will read a rate table of medical codes and rates
    No I won't.
    You will request (prompt) an employee’s number, name, rate code and sex from the user.
    I will not.
    Anybody have idea how to program it in C program
    Thanks
    Yes, I have an idea of how to do this. Wait .. I know how to do this, not just an idea.

    Regards,

    Paul McKenzie

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449
    Another homework assignment?

    Folks, notice that the month is May, the winding down of the school term when assignments are due. There have been a lot of "do my homework" posts lately, as expected. Expect the same peak of such posts in December.

    To the OP -- show us what work you have done. Then ask a specific question as to what problem you are having. Posting a question as if you are the professor and we are the students isn't going to help you.

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    May 2003
    Posts
    2
    The thing is I don't quite have an idea
    I need the idea, then I can do the code
    I don't really know where to start
    Anyway, if you can just give me any helpful website, I will be appreciated

  6. #6
    Join Date
    May 2000
    Location
    Phoenix, AZ [USA]
    Posts
    1,347
    Originally posted by calworld
    The thing is I don't quite have an idea
    I need the idea, then I can do the code
    I don't really know where to start
    Anyway, if you can just give me any helpful website, I will be appreciated
    I'm sure your programming class has taught you some of the
    functions you'll be needing. You'll need to use a struct for the
    employee record. You'll need to read in a data table from the
    user. You'll use printf() to tell the user what to type and you'll
    probably want to use sscanf() to get his input [though there
    are other options]. You'll probably want to input more than one
    structure so you can either use an array of these struct's, or you
    can get fancy and create a dynamically-sizing array by using
    malloc() and free(). For the validation stuff, you will probably
    be using the if keyword. If you need to convert to/from types
    look into the atoi() and sprintf() functions.

    The building blocks are there; you just need to do some work and
    put everything together.

    --Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured