5 Replies - 1267 Views - Last Post: 13 May 2011 - 02:30 PM Rate Topic: -----

#1 gebix   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-May 11

Payroll program need help

Posted 13 May 2011 - 09:38 AM

Well I know I can't ask for code but I'm stock and I need help this is my 3 project and I'm having hard time getting started
I'm posting the question if any one can help me I appreciate it....if you can give me an outline how to write

You are the owner of a medium-sized growing company consisting of more than 100 employees. The company has several departments, each of which might have up to 50 employees (but possibly more). You are developing a Weekly Department Salary Report program. The user will interactively enter information for each employee, including their first name and last name, hourly wage, and number of hours worked. The program should create a report as this information is entered. The report will be stored in a disk file.

The report will include the information entered by the user, plus will show both the regular and overtime hourly wage, regular and overtime pay for the period, and a total pay for the period. The overtime rate is 1.5 times the regular rate, although the legislature is considering changing this within the next year or two. Overtime is currently paid for any time over 40 hours during the period; however, this might change too.


User Interface Specifications

Here is a sample dialog. Your spacing and wording should be the same as it is here. Please note that the yes/no answer in response to "Process another employee?" is a single character, and can be Y, y, N or n. No validation is necessary in this program, so assume that the user types a valid response (one of the ones just mentioned).

Mountain Pacific Corporation
Department Salary Program

Please enter the name of the department: Marketing

Enter employee #1: Juan Arago
Enter the hourly wage of Juan Arago: 12.50
Enter total number of hours: 40

Thank you. Process another employee? Y


The report should look like this


Mountain Pacific Corporation
Department Salary Program

Department: Marketing

Employee                Reg Hrs        Overtime Hrs       Gross
-----------------------------------------------------------------
Juan Arago            40.0 ($12.50)    0.0 ($18.75)    $ 500.00
Winnie Chen           40.0 ($11.45)    5.5 ($17.17)    $ 552.46
Jack Donovan          40.0 ($16.80)   20.0 ($25.20)    $1176.00
Francine Jackson      35.0 ($19.00)    0.0 ($28.50)    $ 665.00
-----------------------------------------------------------------

Total Regular Hours Worked: 155.0
Total Overtime Hours Worked: 25.5
Percentage of Total Hours That Are Overtime: 14.1%

Total Regular Wages: $2295.00
Total Overtime Wages: $598.46

Total Wages This Period: $2893.46

Is This A Good Question/Topic? 0
  • +

Replies To: Payroll program need help

#2 jimblumberg   User is offline

  • member icon

Reputation: 5788
  • View blog
  • Posts: 17,697
  • Joined: 25-December 09

Re: Payroll program need help

Posted 13 May 2011 - 09:46 AM

You must post code showing a reasonable try at completing your program. Your instructions give a fairly clear outline of what is expected. If you have specific questions about the instructions you would probably be better off asking your instructor.

Jim
Was This Post Helpful? 0
  • +
  • -

#3 gebix   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-May 11

Re: Payroll program need help

Posted 13 May 2011 - 09:56 AM

Thanks Jim I have very little of the code but the instructor is not helping that is why am trying here


If someone else can direct me to a sample code I appreciate it .
Was This Post Helpful? 0
  • +
  • -

#4 gebix   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-May 11

Re: Payroll program need help

Posted 13 May 2011 - 10:41 AM

I have this much code I'm stuck how to continue

#include <stdio.h>
#|nclude <string.h>
#include <math.h>

#define REG_HOURS
#define OT_RATE

char dept;
char name[21];
float wage;
float hours;
float overtime;
float ot_time;
float gross_pay;
float Gross;

int main(void) {

    printf("Please enter name of the department\n: ");
    scanf("%f", &dept);
    
    printf("Enter employee #\n: ");
    gets(name);
    
    printf(\n Enter the hourly wage of %c: " name);
    scanf("%f", &wage);
    
    printf(\n Enter total number of hours: ");
    scanf("%f" &hours);
    
    if (hours> REG_HOURS)
            overtime = hours - REG_HOURS
            
    
    
    
    
    
    
    return 0;
}

This post has been edited by JackOfAllTrades: 13 May 2011 - 11:24 AM
Reason for edit:: Added code tags

Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Payroll program need help

Posted 13 May 2011 - 11:24 AM

When you post code, you MUST use CODE TAGS!!!

:code:

If that's too complicated, then read the first link in my signature.
Was This Post Helpful? 0
  • +
  • -

#6 #define   User is offline

  • Duke of Err
  • member icon

Reputation: 1862
  • View blog
  • Posts: 6,711
  • Joined: 19-February 09

Re: Payroll program need help

Posted 13 May 2011 - 02:30 PM

Hi, you need to run the program and sort the errors.
You have code to enter data, you need to print out the data entered to check it is ok.

Next, you need to create an employee struct for employee records.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1