This is my main module. I have a few external modules.
int main(void)
{
char ln[15+1];
char fn[10+1];
float fed,state,ssi;
float g,h,p,d,n;
InputEmployeeData(&ln[0],&fn[0],&h,&p,&d); // call 3.3
CalculateGross(h,p, &g); // call 3.4
computeTaxes(g,d,ADDR(fed),ADDR(state),ADDR(ssi)); // call 3.5
n = g-fed-state-ssi-d;
printf(" Fed = %8.2f\n",fed);
printf(" State = %8.2f\n",state);
printf(" SSI = %8.2f\n",ssi);
printf(" Net = %8.2f\n",n);
while(getchar() != '\n'); // flush(stdin)
return 0;
main.cpp using iostream
cout << " Fed = %8.2f\n" << fed;
cout << " State = %8.2f\n" << state;
cout << " SSI = %8.2f\n" << ssi;
cout << " Net = %8.2f\n" << n;
cin.sync();
//while(getchar() != '\n');
// flush(stdin)
return 0;
inputemployeedata.cpp using stdio.h
//3.3
#include <stdio.h>
#define ADDR(var) &var
void InputEmployeeData(char *lastname,char *firstname, // 3.3
float *hours,float *payrate, float *defr);
void InputEmployeeData(char *lastname,char *firstname, // 3.3
float *hours,float *payrate, float *defr)
{
printf(" Enter the name ==> ");
scanf("%s%s",firstname,lastname);
printf(" Enter the hours and payrate ==> ");
scanf("%f%f",hours,payrate);
printf(" Enter the deferred earning amount ==> ");
scanf("%f",defr);
}
inputemployeedata.cpp using iostream
{
cout << " Enter the name ==> ";
cin >> *firstname >> *lastname;
cout <<" Enter the hours and payrate ==> ";
cin >> *hours >> *payrate;
cout << " Enter the deferred earning amount ==> ";
cin >> *defr;
I Don't know the equivalent of %8.2f
for cout
. I'm just stuck