Don't know what is up with it.
Any help is nice, thanks.
error c2660: 'Totaler' : Function does not take 20 arguments
error c2660: 'Averager' : Function does not take 30 arguments
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "./myheader.h"
void InputEmployeeData(char*lastname, char*firstname,
float*hours, float*payrate, float*deferred);
float CalcGross(float hours, float payrate);
extern void CalcTaxesExt(float gross, float deferred, float *federaltax,
float *statetax, float *ssitax);
void CalcNetPay(float gross, float deferred, float federaltax,
float statetax, float ssitax, float*netpay);
void AddDetailToAccumulators(float hours, float*reghrs, float*ovthrs);
void showReport(FILE*reportfile, char lastname[15+1], char firstname[10+1],
float payrate, float reghrs, float gross,
float federaltax, float ssitax, float netpay,
float ovthrs, float statetax, float deferred);
void Totaler(float *totfedtax, float *totssitax, float *totstatetax,float *totrate, float *totreg,
float *totovt, float *totgross,float *totpay,float *totdeferred, float gross, float federaltax, float statetax,
float ssitax,float hours, float payrate,float deferred,float reghrs,float ovthrs,float netpay);
void Averager(float *totfedtax, float *totssitax, float *totstatetax,float *totrate, float *totreg,
float *totovt, float *totgross,float *totpay,float *totdeferred,float *avgfedtax, float *avgssitax, float *avgstatetaxtax,float *avgrate, float *avgreg,
float *avgovt, float *avggross,float *avgpay,float *avgdeferred, float gross, float federaltax, float statetax,
float ssitax,float hours, float payrate,float deferred,float reghrs,float ovthrs,float netpay);
int main(void)
{
FILE * reportfile;
int counter;
float gross, federaltax,statetax,ssitax,hours, payrate, deferred,
reghrs, ovthrs, netpay, totrate, totreg, totgross,
totfedtax, totssitax, totnet,
totovt, totstatetax, totdeferred, totpay,
avgrate, avgreg, avggross,avgfedtax, avgssitax, avgnet,
avgovt, avgstatetax, avgdeferred, avgpay;
char lastname[15+1],firstname[10+1], combinedName[25+1];
reportfile = fopen("./report.txt","wt");
if (reportfile == NULL)
{
printf(" Error opening report file ...\n");
fflush(stdin);
getchar();
exit(-20);
}
fprintf(reportfile,REPORTHEADING1);
fprintf(reportfile,REPORTHEADING2);
fprintf(reportfile,REPORTHEADING3);
for (counter=0; counter < MAX; counter++)
{
// data input
InputEmployeeData(lastname,firstname,&hours,&payrate,&deferred);
AddDetailToAccumulators(hours,®hrs,&ovthrs);
gross = CalcGross(hours,payrate);
CalcTaxesExt(gross,deferred,&federaltax,&statetax,&ssitax);
CalcNetPay(gross,deferred,federaltax,statetax,ssitax,&netpay);
strcpy(combinedName,lastname);
strcat(combinedName, ", ");
strcat(combinedName,firstname);
// totaller
Totaler(gross, federaltax,statetax,ssitax,hours, payrate, deferred,
reghrs, ovthrs, netpay,
&totrate, &totreg, &totgross,&totfedtax, &totssitax, &totnet,
&totovt, &totstatetax, &totdeferred, &totpay);
// averager
Averager(totrate, totreg, totgross,totfedtax, totssitax, totnet,
totovt, totstatetax, totdeferred, totpay, gross, federaltax,statetax,ssitax,hours, payrate, deferred,
reghrs, ovthrs, netpay,&avgrate, &avgreg, &avggross,&avgfedtax, &avgssitax, &avgnet,
&avgovt, &avgstatetax, &avgdeferred, &avgpay);
fprintf(reportfile,REPORTFORMAT1,combinedName,payrate,
reghrs,gross,federaltax,ssitax,netpay);
fprintf(reportfile,REPORTFORMAT2,ovthrs,statetax,deferred);
}
fprintf(reportfile,REPORTFORMAT1,totrate,totreg,totgross,totfedtax,totssitax,totnet);
fprintf(reportfile,REPORTFORMAT2,totovt,totstatetax,totdeferred);
fprintf(reportfile,REPORTFORMAT1,avgrate,avgreg,avggross,avgfedtax,avgssitax,avgnet);
fprintf(reportfile,REPORTFORMAT2,avgovt,avgstatetax,avgdeferred);
fclose(reportfile);
printf("Press any button to close");
fflush(stdin);
getchar();
return 0;
}
//functions
void showReport(FILE*reportfile, char lastname[15+1], char firstname[10+1],
float payrate, float reghrs, float gross,
float fedtax, float ssitax, float netpay,
float ovthrs, float statetax, float deferred);
void InputEmployeeData(char *lastname, char *firstname,
float *hours, float *payrate, float *deferred)
{
printf(" Enter Employee's Last and First Name : ");
scanf("%s%s",lastname,firstname);
printf(" Enter Hourly Pay Rate : ");
scanf("%f",payrate);
printf(" Enter Total Hours Worked This Period : ");
scanf("%f",hours);
printf(" Enter Amount of Deferred Earnings : ");
scanf("%f",deferred);
}
void AddDetailToAccumulators(float hours, float*reghrs, float*ovthrs)
{
if (hours <= 40)
*reghrs = hours,
*ovthrs = 0.00;
else
*reghrs = 40.00,
*ovthrs = (hours-40);
}
void CalcNetPay(float gross, float deferred, float fedtax,
float statetax, float ssitax, float*netpay)
{
*netpay = (gross-(deferred+fedtax+statetax+ssitax));
}
float CalcGross(float hours, float payrate)
{
if (hours <= 40)
return hours * payrate;
else
return 40 * payrate + (hours-40) * 1.5 * payrate;
}
void Averager(float totfedtax, float totssitax, float totstatetax,float totrate, float totreg,
float totovt, float totgross,float totpay,float totdeferred,
float *avgfedtax, float *avgssitax, float *avgstatetax,float *avgrate, float *avgreg,
float *avgovt, float *avggross,float *avgpay,float *avgdeferred, float gross, float federaltax, float statetax,
float ssitax,float hours, float payrate,float deferred,float reghrs,float ovthrs,float netpay)
{
*avgfedtax=totfedtax/MAX;
*avgstatetax=totstatetax/MAX;
*avgssitax=totssitax/MAX;
*avgrate=totrate/MAX;
*avgdeferred=totdeferred/MAX;
*avgreg=totreg/MAX;
*avgovt=totovt/MAX;
*avggross=totgross/MAX;
*avgpay=totpay/MAX;
}
void Totaler(float *totfedtax, float *totssitax, float *totstatetax,float *totrate, float *totreg,
float *totovt, float *totgross,float *totpay,float *totdeferred, float gross, float federaltax, float statetax,
float ssitax,float hours, float payrate,float deferred,float reghrs,float ovthrs,float netpay)
{
*totfedtax+=federaltax;
*totstatetax+=statetax;
*totssitax+=ssitax;
*totrate+=payrate;
*totdeferred+=deferred;
*totreg+=reghrs;
*totovt+=ovthrs;
*totgross+=gross;
*totpay+=netpay;
}