#include <stdio.h>
#include <float.h>
float grosssalarycalc(float value1,float value2){
float gsalary;
gsalary=value1+value2;
return (gsalary);
}
float ovtmpayoutcalc(float value1){
float ovtmpayout;
ovtmpayout=25*value1;
return (ovtmpayout);
}
float netpayoutcalc(float value1){
float netsalary;
netsalary=value1-(value1*0.20);
return (netsalary);
}
int main() {
char name[32];
float ovtmpayout0,gross,net,ovtmhrs,salary;
printf("Payroll Calculation Program\n");
printf("Employee, please enter your name:\n");
scanf("%s", name);
printf("Employee, please enter your salary:\n");
scanf("%f", &salary);
printf("Employee, how many overtime hours have you worked?\n");
scanf("%f",&ovtmhrs);
printf("---------------------\n\n");
ovtmpayout0=ovtmpayoutcalc(ovtmhrs);
gross=grosssalarycalc(salary,ovtmpayout0);
net=netpayoutcalc(gross);
printf("October 16th, 2012\n");
printf("Employee Name: %s\n", name);
printf("Overtime Hours Worked: %.0f\n", ovtmhrs);
printf("Gross Payout: %.2f\n", gross);
printf("Net Salary: %.2f\n", net);
system ("pause");
return 0;
}
swiss21 -11 Newbie Poster
ram619 8 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.