Question

In: Computer Science

Write a program to process weekly employee time cards for all employees of an organization. Each...

Write a program to process weekly employee time cards for all employees of an organization. Each employee will have three data items: an identification number, the hourly wage rate, and the number of hours worked during a given week. Each employee is to be paid time and a half for all hours worked over 40. A tax amount of 3.625% of gross salary will be deducted. The program output should show the employee’s number and net pay. Display the total payroll and the average amount paid at the end of the run.

Please do this code in the language C

Solutions

Expert Solution

/* program to process weekly employee time cards for all employees of an organization*/
#include <stdio.h>
//structure is used to manage 3 dataparts of all employees in organization
struct emp {
char empid[50];
int wagerate;
int workhours;
} empdata[100];
int main()
{
   int num,i,payment,overtime,sum=0;                           //varible declarations
   float avg;
   struct    emp empdata[100];                                              

printf("Enter Number of Employees in Organization\n");           //prompt for asking number of employees
scanf("%d",&num);                                                       //read number of employees
for(i=1;i<=num;i++)                                               //using loop take data of all employees
{
    printf("Enter ID\n");
    scanf("%s",empdata[i].empid);                                       //read employee id
    printf("Enter Hourly wage Rate for %s \n",empdata[i].empid);
    scanf("%d",&empdata[i].wagerate);                                       //read employee wagerate
    printf("Enter Number Hours worked per week by %s \n",empdata[i].empid);
    scanf("%d",&empdata[i].workhours);                                       //read employee work hours
    //printf("\n%d\t%d\t",empdata[i].wagerate,empdata[i].workhours);
   
}
for(i=1;i<=num;i++)                                                   //loop to generate outputs for all employees
{
    printf("\nProcessing Payrolls .....\n");
    if (empdata[i].workhours>40)                                       //check employee done overtime then calculate payment
    {
        overtime=empdata[i].workhours-40;
        payment=(overtime)*((empdata[i].wagerate)/2)+(empdata[i].workhours)*(empdata[i].wagerate); //calculate payment for employee id if workhours >40
        sum=sum+payment;
   }
   else                                                              
   {
           payment=(empdata[i].workhours)*(empdata[i].wagerate); //calculate payment for employee id if workhours <40
           sum=sum+payment;
   }
   printf("ID %s\t - \t Payment is \t%d\n ",empdata[i].empid,payment); //display employee id and net payement
   
}
printf("Total payroll %d \n ",sum);                                   //display final pay raoll amount
avg=sum/num;
printf("Average amount paid per employee %f \n ",avg);           //display average payment per employee

return 0;
}

Note : enter less number of employess to enter less input .

Output :

1111
Enter Hourly wage Rate for 1111
100
Enter Number Hours worked per week by 1111
10

Enter ID
2222
Enter Hourly wage Rate for 2222
200
Enter Number Hours worked per week by 2222
10


Processing Payrolls .....
ID 1111 - Payment is 1000

Processing Payrolls .....
ID 2222 - Payment is 2000
Total payroll 3000
Average amount paid per employee 1500.000000


Related Solutions

Write a program in C to process weekly employee timecards for all employees of an organization...
Write a program in C to process weekly employee timecards for all employees of an organization (ask the user number of employees in the start of the program). Each employee will have three data items: an identification number, the hourly wage rate, and the number of hours worked during a given week.A tax amount of 3.625% of gross salary will be deducted. The program output should show the identification number and net pay. Display the total payroll and the average...
EMPLOYEE (Inheritance) Write a program that maintains wage information for the employees of a company. The...
EMPLOYEE (Inheritance) Write a program that maintains wage information for the employees of a company. The following example shows what the user will see during a session with the program: N: New employee P: Compute paychecks R: Raise wages L: List all employees Q: Quit Enter command: n Enter name of new employee: Plumber, Phil Hourly (h) or salaried (s): h Enter hourly wage: 40.00 (Note: Do Not VALIDATE) N: New employee P: Compute paychecks R: Raise wages L: List...
An important tactic for retaining employees is a good employee recognition program within the organization. Here...
An important tactic for retaining employees is a good employee recognition program within the organization. Here we what to examine how common they are in small (and large) businesses. With that in mind, you interview 376 of each kind. You find that 278 of the small organizations said they have an employee recognition program, while 316 of the large ones said they have an employee recognition program. We are trying to prove that larger organizations are more likely to have...
Write a program of doubly Circular linked list to maintain records of employees. Take employee ID,...
Write a program of doubly Circular linked list to maintain records of employees. Take employee ID, name and salary as data of each employee. Search a particular record on ID and display the previous and next records as well. Whichever ID it give, it should display all the records because of being circular. Code needed in Java.
It is common for an organization to have different categories of employees, such that one Employee...
It is common for an organization to have different categories of employees, such that one Employee class can not easily describe all types of Employees.In this project, you will code a basic Employee class, and then a number of classes which derive from the Employee class (inherit), adding Employee specifics. An application program which stores info for one company will have use objects of different types to model the all employees. Part I:   The Employee Class First create the Employee...
About the organization: This fictional organization has a small, but growing, employee base, with 50 employees...
About the organization: This fictional organization has a small, but growing, employee base, with 50 employees in one small office. The company is an online retailer of the world's finest artisanal, hand-crafted widgets. They've hired you on as a security consultant to help bring their operations into better shape. Organization requirements: As the security consultant, the company needs you to add security measures to the following systems: An external website permitting users to browse and purchase widgets An internal intranet...
If a company provides a group hospitalization insurance plan for all employees and charges each employee...
If a company provides a group hospitalization insurance plan for all employees and charges each employee for the premium. The premium is $7,000 for each employee, and none of the employees can deduct the medical insurance from their taxes since they do not meet the 7 1/2 percent floor. The company is considering paying for employees insurance next year in place of raises. If the company adopts this change, the employee's after-tax and insurance pay will: a. Decrease by the...
Write a program in c++ that picks four cards from a deck of 52 cards and...
Write a program in c++ that picks four cards from a deck of 52 cards and computes the sum of the four cards. An Ace, King, Queen, and Jack represent 1, 13, 12, and 11, respectively. Your program should display the number of picks that yields the sum of 24. You are not allowed to use arrays. Declare four variables to hold the card values.
Grouper Company pays its office employee payroll weekly. Below is a partial list of employees and...
Grouper Company pays its office employee payroll weekly. Below is a partial list of employees and their payroll data for August. Because August is their vacation period, vacation pay is also listed. Employee --Earnings to July 31----    Weekly Pay-----    Vacation Pay to Be Received in August Mark Hamill $5,010    $200    --- Karen Robbins $4,310 $150    $300 Brent Kirk    $3,510 $110 $220 Alec Guinness    $8,210 $250 --- Ken Sprouse    $8,810 $330    $660...
Pina Company pays its office employee payroll weekly. Below is a partial list of employees and...
Pina Company pays its office employee payroll weekly. Below is a partial list of employees and their payroll data for August. Because August is their vacation period, vacation pay is also listed. Employee Earnings to July 31 Weekly Pay Vacation Pay to Be Received in August Mark Hamill $5,200 $240 - Karen Robbins 4,500 190 $380 Brent Kirk 3,700 150 300 Alec Guinness 8,400 290 - Ken Sprouse 9,000 370 740 Assume that the federal income tax withheld is 10%...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT