求救:c语言课程设计 员工工资管理程序 有加分的。谢谢

来源:百度知道 编辑:UC知道 时间:2024/09/23 06:02:26
题目:员工工资管理系统
用链表。
具体要求:
1.每个员工信息为:编号、姓名、部门、应发工资、税金、实发工资。
2.税金计算公式:2500>=工资>1600 10%
3500>=工资>2500 20%
工资>3500 30%
实发工资=应发工资-税金
3.编辑员工信息
(1)修改职工信息
(2)删除职工信息

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <conio.h>
#define SIZE 50

/* 定义结构体 */
struct date
{int month;
int day;
int year;
};
typedef struct employee
{char name[50] ,num[10],sex,edu[10],duty[15];
int age,income;
struct employee *next;
}empl[SIZE];

/* 逐项输出链表中的内容 */
void view (struct employee* head)
{
struct employee * p;
p = head;
while (p != NULL)
{
printf("%-10s%-15s%3c%-10s%-8s%6d%9d\n", p->name, p->num,p->sex, p->edu,p->duty, p->age,p->income);
p = p->next;
}
}

/* 定义保存函数 */
void save ()
{FILE *fp;
int i;
if ((fp=fopen("emp_list","wb"))==NULL)
{printf("cannot open file\n");
return;
}
for (i=0;i<SIZE;i++)
if (fwrite(&empl,sizeof(stru