Click to See Complete Forum and Search --> : Help with C programming


calworld
May 4th, 2003, 09:28 AM
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

mwilliamson
May 4th, 2003, 10:48 AM
i have an idea.

Paul McKenzie
May 4th, 2003, 11:17 AM
Originally posted by calworld
You will read a rate table of medical codes and ratesNo 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

Paul McKenzie
May 4th, 2003, 11:26 AM
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

calworld
May 4th, 2003, 01:55 PM
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

PaulWendt
May 4th, 2003, 02:43 PM
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