ok i've created the prototype program of a payroll system the problem is i don't know how it would write something into a file and load it again i've attached my code here since i dont know anything about the command and what to do on how to write in to a file
Code:
#include <stdio.h>
#define p printf
#define g gotoxy
#define s scanf
main()
{
int emp;
char name[16],sel,choice;
float OH,HpW,BR,OT,GP,OM,mpW,HR,OTM,ToT,HWW,ompW;
clrscr();
p("Enter Employee Code : ");s("%d",&emp);
p("\nEnter Employee Name : ");s("%s",&name);
p("\nEnter Total Overtime Hours : ");s("%f",&OH);
p("\nEnter Total Overtime Minutes : ");s("%f",&OM);
p("\nEnter Total Hours of Work/Week : ");s("%f",&HpW);
p("\nEnter Total minutes of Work/Week : ");s("%f",&mpW);
if(emp==1)
{BR=380;}
if(emp==2)
{BR=450;}
if(emp==3)
{BR=550;}
HR=BR/8;
OTM=OM/60;
ompW=mpW/60;
OT=HR*1.1*OH;
HWW=ompW+mpW;
ToT=OTM+OH;
GP=HR*HWW+ToT;
clrscr();
switch(emp)
{
case 1:
{
p("\nEmployee Code: Waiter\n");
p("\nEmployee Name: %s\n",name);
p("\nGross Pay: %f\n",GP);
break;
}
case 2:
{
p("\nEmployee Code: Cashier\n");
p("\nEmployee Name: %s\n",name);
p("\nGross Pay: %f\n",GP);
break;
}
case 3:
{
p("\nEmployee Code: Manager\n");
p("\nEmployee Name: %s\n",name);
p("\nGross Pay: %f\n",GP);
break;
}
}
getch();
return 0;
}