156k views
1 vote
You are tasked with composing a program to compute the payroll earnings for the sales force at the Arctic Ice company. All sales employees are on a straight commission basis of 12.5% of gross sales. The sales manager calculates the bonuses separately. Your program is needed to calculate the withholdings and deductions from the employee’s gross pay. Your program must calculate the federal and state withholdings (taxes) and also the retirement contribution of each employee

A. 25% Federal withholding
B. 10% State withholding
C. 8% Retirement plan
Salesperson Sales Bonus
1 53,500 425
2 41,00 300
3 56,800 350
4 36,200 175

1 Answer

2 votes

Answer:

Programming language: C

Code:

#include<stdio.h>

double fed_with(double total){ //declaring the functions

return 0.25*total;

}

double ste_with(double total){

return 0.1*total;

}

double ret_plan(double total){

return 0.08*total;

}

int main(){

double sales[4][2],total,fw,sw,rp; //variables to be used

int i,j;

for(i=0;i<4;i++){ //taking input loop

printf("Salesperson %d: (Sales + Bonus)\t", i+1);

scanf("%lf %lf",&sales[i][0],&sales[i][1]);

printf("\\");

}

for(i=0;i<4;i++){ //printing payroll loop

printf("Salesperson %d: Statement\\", i+1);

total = 0.125*sales[i][0]+sales[i][1];

printf("Sales + Bonus: %lf\\",sales[i][0]+sales[i][1]);

printf("Total: %lf\\",total);

fw=fed_with(total);

printf("Federal Withholding: %lf\\",fw);

sw=ste_with(total);

printf("State Withholding: %lf\\",sw);

rp=ret_plan(total);

printf("Retirement Plan: %lf\\",rp);

printf("Final: %lf\\",total-fw-sw-rp);

printf("\\");

}

return 0;

}

Step-by-step explanation:

User Shakeel
by
5.2k points