员工管理系统c语言程序设计源代码
(2010-06-10 11:38:40)
标签:
杂谈 |
分类: C源码 |
#include<string.h>
#include<stdio.h>
#define N
10000
typedef struct wage
{
float
wage1;
float
Bonus;
float
tax;
float
S_fee;
float
D_fee;
float
T_fee;
float
Q_fee;
float
S_wage;
}WAGE;
typedef struct worker
{
char
ID[10];
char
ID_Wage[10];
char
depart[10];
char
sex;
char
m_phone[10];
char
H_phone[10];
}WORK;
WORK wo[N];
int n;
void menu();
void menu1();
save()
{
int w=1;
FILE *fp;
int i;
system( "cls" );
if((fp=fopen("work.txt","wb"))==NULL)
{
}
if(fwrite(&wo[i],sizeof(struct
worker),1,fp)!=1)
{
}
if(w==1)
{
}
fclose(fp);
getch();
menu();
}
load()
{
FILE *fp;
int i,w;
w=1;
system( "cls" );
if((fp=fopen("work.txt","rb"))==NULL)
{
}
n=0;
for(i=0;!feof(fp);i++)
{
}
n=n-1;
fclose(fp);
if(w==1)
getch();
menu();
return(i-1);
}
void no_input(int i,int
n)
{
int j,k,w1;
do
{
}while(w1==1);
}
float tax(float s)
{
float tax;
if(s<=800)
else
if(s>800&&s<=1400)
}
void input(int
i)
{
fflush(stdin);
gets(wo[i].name);
printf("Bank ID:");
fflush(stdin);
gets(wo[i].ID_Wage);
printf("grade");
scanf("%d",&wo[i].ID_P);
printf("Department:");
fflush(stdin);
gets(wo[i].depart);
scanf("%d",&wo[i].age);
fflush(stdin);
scanf("%c",&wo[i].sex);
fflush(stdin);
gets(wo[i].m_phone);
fflush(stdin);
gets(wo[i].H_phone);
printf("basic salary");
scanf("%f",&wo[i].salary.wage1);
wo[i].salary.tax=tax(wo[i].salary.wage1);
printf("Bonus:");
scanf("%f",&wo[i].salary.Bonus);
printf("water fee:");
scanf("%f",&wo[i].salary.S_fee);
printf("dian fee:");
scanf("%f",&wo[i].salary.D_fee);
printf("QingJie fee:");
scanf("%f",&wo[i].salary.Q_fee);
printf("TV fee:");
scanf("%f",&wo[i].salary.T_fee);
}
void enter()
{
int i;
system( "cls" );
printf("How many record(0-%d)?:",N);
scanf("%d",&n);
printf("\nEnter data now\n\n");
for(i=0;i<n;i++)
{
getch();
menu();
}
void printf_one(int
i)
{
int j;
printf("%11s
}
void printf_one_s(int
i)
{
int j;
printf("
}
void
browse()
{
int i,j;
system( "cls" );
puts("\n--------------------------------------------------------------------");
printf("\n\t工号 姓名
银行卡号
for(i=0;i<n;i++)
{
}
puts("\n--------------------------------------------------------------------");
printf("\tThere
are
getch();
menu();
}
int
search_by_ID()
{
int i,k;
struct worker s;
k=-1;
system( "cls" );
printf("\n\nEnter the ID:");
scanf("%s",s.ID);
for(i=0;i<n;i++)
{
}
if(k==-1)
{
}
else
{
}
}
int
search_by_age()
{
int i,k,t_age,b_age;
struct worker s;
k=-1;
system( "cls" );
printf("\n\nEnter the top age:");
scanf("%d",&t_age);
printf("\n\nEnter
the
scanf("%d",&b_age);
printf("\n\t工号 姓名
银行卡号
for(i=0;i<n;i++)
{
}
if(k==-1)
{
}
else
{
}
}
void
count_by_P()
{
int i,k;
float
S_sal[3]={0,0,0},sal[3]={0,0,0},bon[3]={0,0,0},tax[3]={0,0,0};
for(i=0;i<n;i++)
{
}
printf("实发工资:%f,基本工资:%f,奖金:%f,税金:%f\n",S_sal[0],sal[0],bon[0],tax[0]);
printf("\n级别为中级工程师的工资统计为:\n");
printf("实发工资:%f,基本工资:%f,奖金:%f,税金:%f\n",S_sal[1],sal[1],bon[1],tax[1]);
printf("\n级别为初级工程师的工资统计为:\n");
printf("实发工资:%f,基本工资:%f,奖金:%f,税金:%f\n",S_sal[2],sal[2],bon[2],tax[2]);
printf("\n公司所有人员的工资统计为:\n");
printf("实发工资:%f,基本工资:%f,奖金:%f,税金:%f\n",S_sal[2],sal[2],bon[2],tax[2]);
getch();
menu1();
}
void
order()
{
int i,j,k;
struct worker s;
system( "cls" );
for(i=0;i<n-1;i++)
{
printf("The ordered data is:\n");
browse();
getch();
menu1();
}
void menu1()
{
int n,w1;
switch(n)
{
}
void menu()
{
int n,w1;