当前位置:首页 » 编程语言 » c语言员工工资管理系统

c语言员工工资管理系统

发布时间: 2023-01-15 20:38:05

‘壹’ c语言 工资管理系统

这个要靠调试了,不过有时候调试可能还不如重写快,可以帮写

‘贰’ c语言编一个工资管理系统 本系统能够方便、灵活地实现职工工资的输入、添加、删除等编辑操作以及查询等

*/#include "stdafx.h"
#include "iostream"
#include "string"
#include "list"
#include "cassert"
using namespace std;/*
编号、姓名、部门、应付工资、保险、税金、实付工资。
其中实付工资由公式计算得到:实付工资=应付工资 - 保险- 税金
*/
struct employee{
string m_num;//编号
string m_name;//姓名
string m_dep;//部门
double m_salary;//应付工资
double m_insurance;//保险
double m_tax;//税金
};/*
(1)录入:输入职工数据,其中“实付工资”通过计算得到;
(2)删除:删除指定的职工信息(输入姓名,若找到则删除该信息)
(3) 修改:允许对已经录入的数据重新进行编辑、修改;
(4) 显示:显示全体职工数据;
(5)查询:
a. 输入职工姓名,显示该职工的全部数据;
b. 输入某部门值,显示该部门职工的数据、工资总额、平均工资。
(6) 退出程序。
*/list<employee> emps;int _tmain(int argc, _TCHAR* argv[])
{
void print(const employee &e);
void input();
void del();
void mod();
void show_all();
void show_name();
void show_dep();cout<<"简易职工薪水管理程序 by 做他\n";// delete this line
cout<<"版权没有 请随意复制或修改任何代码\n";//delete this linecout<<"请选择操作:1.录入 2.删除 3.修改 4.查询 5.显示所有员工 6.退出 :";
int choose=0;
cin>>choose;
assert(!cin.fail());
while (choose!=6)
{
if (choose==1) input();
if (choose==2) del();
if (choose==3) mod();
if (choose==4)
{
int choice=0;
cout<<"请选择操作 1.按姓名查询 2.按部门查询 3.退出:";
cin>>choice;
if (choice==1) show_name();
if (choice==2) show_dep();
if (choice==3)
{
cout<<"请选择操作:1.录入 2.删除 3.修改 4.查询 5.显示所有员工 6.退出 :";
cin>>choose;
assert(!cin.fail());
continue;
}
}
if (choose==5) show_all();
cout<<"请选择操作:1.录入 2.删除 3.修改 4.查询 5.显示所有员工 6.退出 :";
cin>>choose;
assert(!cin.fail());
}
return 0;
}void print(const employee &e)
{
cout<<"编号:"<<e.m_num<<endl;
cout<<"姓名:"<<e.m_name<<endl;
cout<<"部门:"<<e.m_dep<<endl;
cout<<"保险:"<<e.m_insurance<<endl;
cout<<"税金:"<<e.m_tax<<endl;
cout<<"应付工资:"<<e.m_salary<<endl;
cout<<"实付工资:"<<e.m_salary-e.m_insurance-e.m_tax<<endl;
}void input()
{
string num,name,dep;
double salary,ins,tax;
cout<<"请输入员工编号:";
cin>>num;
cout<<"请输入员工姓名:";
cin>>name;
cout<<"请输入员工部门:";
cin>>dep;
cout<<"请输入员工保险:";
cin>>ins;
assert(!cin.fail());
cout<<"请输入员工税金:";
cin>>tax;
assert(!cin.fail());
cout<<"请输入员工应付工资:";
cin>>salary;
assert(!cin.fail());
employee temp;
temp.m_dep=dep;
temp.m_insurance=ins;
temp.m_name=name;
temp.m_num=num;
temp.m_salary=salary;
temp.m_tax=tax;
emps.push_back(temp);
cout<<"员工录入操作完毕.\n";
}void del()
{
if (emps.size()==0)
{
cout<<"没有员工记录.\n";
return;
}
string name;
bool isfind=false;
cout<<"请输入要删除的员工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
emps.erase(iter);
cout<<"姓名为\""<<name<<"\"的员工记录已删除.\n";
return;
}
}
if (!isfind)
{
cout<<"没有找到姓名为\""<<name<<"\"的员工.\n";
return;
}
}void mod()
{
if (emps.size()==0)
{
cout<<"员工记录为空.\n";
return;
}
bool isfind=false;
string name;
cout<<"请输入要修改的员工姓名:";
cin>>name;
list<employee>::iterator iter;
for (iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名为\""<<name<<"\"的员工记录已找到.\n";
break;
}
}
if (isfind)
{
string num,name,dep;
double tax,ins,salary;
print(*iter);
cout<<endl;
cout<<"请输入新的员工编号:";
cin>>num;
cout<<"请输入新的员工姓名:";
cin>>name;
cout<<"请输入新的员工部门:";
cin>>dep;
cout<<"请输入新的员工保险:";
cin>>ins;
assert(!cin.fail());
cout<<"请输入新的员工税金:";
cin>>tax;
assert(!cin.fail());
cout<<"请输入新的员工工资:";
cin>>salary;
assert(!cin.fail());
iter->m_dep=dep;
iter->m_insurance=ins;
iter->m_name=name;
iter->m_num=num;
iter->m_salary=salary;
iter->m_tax=tax;
cout<<"1 员工记录被成功修改.\n";
}
else
{
cout<<"没有找到姓名为\""<<name<<"\"的员工记录.\n";
}
}void show_all()
{
if (emps.size()==0)
{
cout<<"员工记录为空.\n";
return;
}
cout<<"显示全体员工数据:\n";
cout<<"--------------------\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
cout<<endl;
print(*iter);
cout<<endl;
}
cout<<"--------------------\n";
}void show_name()
{
if (emps.size()==0)
{
cout<<"员工记录为空.\n";
return;
}
bool isfind=false;
string name;
cout<<"请输入要查询的员工姓名:";
cin>>name;
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_name==name)
{
isfind=true;
cout<<"姓名为\""<<name<<"\"的员工记录已找到.\n";
print(*iter);
break;
}
}
if (!isfind)
{
cout<<"没有找到姓名为\""<<name<<"\"的员工.\n";
return;
}
}void show_dep()
{
if (emps.size()==0)
{
cout<<"员工记录为空.\n";
return;
}
double isfind=0.00;
double total_salary=0.00;
string dep;
cout<<"请输入要查询的部门名称:";
cin>>dep;
cout<<"部门["<<dep<<"]的员工信息:\n";
cout<<"--------------------\n\n";
list<employee>::iterator iter;
for(iter=emps.begin();iter!=emps.end();iter++)
{
if (iter->m_dep==dep)
{
isfind++;
total_salary+=iter->m_salary;
print(*iter);
cout<<endl;
continue;
}
}
cout<<"--------------------\n";
if (isfind==0)
{
cout<<"没有找到名称为["<<dep<<"]的部门.\n";
}
else
{
cout<<"部门["<<dep<<"]工资统计:\n";
cout<<"工资总额:"<<total_salary<<endl;
cout<<"平均工资:"<<total_salary/isfind<<endl;
}
}

‘叁’ c语言 职工工资管理系统

怎么没有人回答

http://www..com/s?lm=0&si=&rn=10&tn=bdpage_pg&ie=gb2312&ct=0&wd=%D6%B0%B9%A4%B9%A4%D7%CA%B9%DC%C0%ED%CF%B5%CD%B3&pn=10&ver=0&cl=3&uim=1&usm=0

‘肆’ 如何用C语言编写一个员工工资管理系统

哥们,这可是一个系统,你才给10分,敲代码都得敲几个月,10万块差不多,应该有人接外单,发给我的话我会接。
建议你直接去买个吧,约10-20万

‘伍’ c语言程序设计、工资管理系统

#include <stdio.h>
#include <malloc.h>
#include <string.h>
typedef struct
{
char num[10];
char name[20];
char date[15];
double pay;
}employee;
typedef struct node
{
employee p;
struct node *pre;
struct node *next;
}node,*linklist;

linklist head,last;

void setData(linklist p)
{
printf("编号:");
scanf("%s",&p->p.num);
printf("姓名:");
scanf("%s",&p->p.name);
printf("入职时间:");
scanf("%s",&p->p.date);
printf("工资:");
scanf("%lf",&p->p.pay);
}

void Insert(linklist p)
{
setData(p);
p->next=last;
last->pre->next=p;
p->pre=last->pre;
last->pre=p;
}
void Add()
{
char ch;
do
{
linklist p=(linklist)malloc(sizeof(node));
system("cls");
Insert(p);
printf("是否继续?");
scanf(" %c",&ch);
}while(ch=='y'||ch=='Y');
}

linklist Qur(int method)
{
char ch[20];
linklist p=head->next;
if(method==0)
{
printf("选择查询方式:(1 姓名、2 年月)");
scanf("%d",&method);
}
if(method==1)
{
printf("输入姓名:");
scanf("%s",ch);
while(p!=last)
{
if(strcmp(ch,p->p.name)==0) break;
p=p->next;
}
}
else if(method==2)
{
printf("输入年月:");
scanf("%s",ch);
while(p!=last)
{
if(strcmp(ch,p->p.date)==0) break;
p=p->next;
}
}
if(p==last) {printf("未找到\n");system("pause");}
return p;
}

void Del()
{
linklist p=Qur(1);
if(p==last) return;
p->pre->next=p->next;
p->next->pre=p->pre;
free(p);
printf("删除成功\n");
system("pause");
}

void Modify()
{
linklist p=Qur(1);
if(p==last) return ;
setData(p);
}
void printTitle()
{
printf("编号\t名称\t入职日期\t工资\n");
}

void show(linklist p)
{
printf("%s\t%s\t%s\t%.2lf\n",p->p.num,p->p.name,p->p.date,p->p.pay);
}
void Sort()
{
linklist p,q;
for (p=head->next;p!=last;p=p->next)
{
for (q=p->next;q!=last;q=q->next)
{
if(p->p.pay<q->p.pay)
{
employee temp=p->p;
p->p=q->p;
q->p=temp;
}
}
}
printf("完成\n");
system("pause");
}

void Tongji()
{
linklist p=head->next;
Sort();
printTitle();
while(p!=last)
{
show(p);
p=p->next;
}
system("pause");
}

void Wrong()
{
printf("输入错误!\n");
system("pause");
}
void menu(void)
{
system("cls");
printf("********工资管理系统*******\n");
printf("* *\n");
printf("* 1:添加 *\n");
printf("* 2:删除 *\n");
printf("* 3:查询 *\n");
printf("* 4:修改 *\n");
printf("* 5:统计 *\n");
printf("* 6:排序 *\n");
printf("* 0:退出 *\n");
printf("* *\n");
printf("*******************************\n");
}

int select()
{
int choose;
scanf("%d",&choose);
switch(choose)
{
case 1:Add();break;
case 2:Del();break;
case 3:
{
linklist p=Qur(0);
if(p!=last) {show(p);system("pause");}break;
}
case 4:Modify();break;
case 5:Tongji();break;
case 6:Sort();break;
case 0:break;
default:Wrong();break;
}
return choose;
}
void destroy()
{
linklist p=head->next;
while(p!=last)
{
head->next=p->next;
free(p);
p=head->next;
}
free(head);
free(last);
}
int main(void)
{
head=(linklist)malloc(sizeof(node));
last=(linklist)malloc(sizeof(node));
head->next=last;
last->next=NULL;
last->pre=head;
head->pre=NULL;
do
{
menu();
} while (select()!=0);
destroy();
return 0;
}

‘陆’ 用c语言编写工资管理系统

程序名称:工资管理系统
程序说明:

该系统在磁盘上储存了某单位上月全体员工的工资信息,对于每一位职工存储以下信息:
月份,职工编号,基本工资,津贴,岗贴,补贴,房贴,交通补贴,应发数,房租,储蓄,
会费,个人所得税,应扣数,实发数。

工资管理系统详细代码参考一下http://wenku..com/view/c9af1211cc7931b765ce15d3.html

‘柒’ 用C语言设计职工工资管理系统

#include<iostream.h>
#include<stdlib.h>
#include<string.h>
#include<iomanip.h>
using namespace std;
#define OK 1
#define ERROR 0
typedef struct LNode{
char num[20];
char name[20];
double basic;
double reward;
double total;
struct LNode *next;
}LNode,*LinkList; int initlist(LinkList &L)
{ L=(LinkList)malloc(sizeof(LNode));
L->next=NULL;
return OK;
} int DisplayInfo(LinkList L)
{
LinkList p=L->next;
if(!p)
{
cout<<"当前无记录!"<<endl;
return ERROR;
}
cout<<"编号"<<setw(12)<<"姓名"<<setw(12)<<"基本工资"<<setw(9)<<"奖金"<<setw(12)<<"工资总额"<<endl; while(p!=NULL)
{
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
p=p->next;
}
cout<<'\n'<<'\n';
return OK;
} int InputInfo(LinkList &L)
{
LinkList p; p=(LinkList)malloc(sizeof(LNode));
cout<<"请输入职工工资信息:(格式如:2001001 james 1980 600 )"<<endl;
cin>>p->num;
cin>>p->name;
cin>>p->basic;
cin>>p->reward;
p->total=p->basic+p->reward;
p->next=L->next;
L->next=p; return OK;
}int DeleteByCode(LinkList &L,char key[])
{
LinkList p=L,q;
while(p->next!=NULL)
{
if(strcmp(p->next->num,key)==0)
{
q=p->next;
p->next=q->next;
free(q);
return OK;
}
p=p->next;
}
return ERROR;} int Search(LinkList L,int tag)
{
LinkList p=L->next;
if(tag==1)
{
char num[20];
cout<<"请输入要查找职工编号号:"<<endl;
cin>>num;
while(p)
{
if(strcmp(p->num,num)==0)
{
cout<<"编号"<<setw(12)<<"姓名"<<setw(12)<<"基本工资"<<setw(9)<<"奖金"<<setw(12)<<"工资总额"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<'\n';
return OK;
}
p=p->next;
}
}
else if(tag==2)
{
char name[20];
cout<<"请输入要查找的姓名:"<<endl;
cin>>name;
while(p)
{
if(strcmp(p->name,name)==0)
{
cout<<"编号"<<setw(12)<<"姓名"<<setw(12)<<"基本工资"<<setw(9)<<"奖金"<<setw(12)<<"工资总额"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<'\n';
return OK;
}
p=p->next;
}
}
else
cout<<"输入错误!"<<endl;
return ERROR;}
int Sort(LinkList &L)
{
LinkList p;

LinkList q,min,w=L;
for(p=L->next;p->next;p=p->next)
{
min=p;
for(q=p->next;q;q=q->next) if(min->total>q->total)
min=q; if(min!=p)
{ strcpy(w->num,p->num);
strcpy(w->name,p->name);
w->basic=p->basic;
w->reward=p->reward;
w->total=p->total;
strcpy(p->num,min->num);
strcpy(p->name,min->name);
p->basic=min->basic;
p->reward=min->reward;
p->total=min->total;
strcpy(min->num,w->num);
strcpy(min->name,w->name);
min->basic=w->basic;
min->reward=w->reward;
min->total=w->total; }
}
return OK;
}
int change(LinkList &L)
{
LinkList p=L->next;

char q[20];
cout<<"请输入要修改的职工编号号:"<<endl;
cin>>q;
while(p)
{
if(strcmp(p->num,q)==0)
{
cout<<"编号"<<setw(12)<<"姓名"<<setw(12)<<"基本工资"<<setw(9)<<"奖金"<<setw(12)<<"工资总额"<<endl;
cout<<p->num<<setw(9)<<p->name<<setw(8)<<p->basic<<setw(12)<<p->reward<<setw(12)<<p->total<<endl;
cout<<"请重新输入该职工的工资信息:"<<endl;
cin>>p->basic;
cin>>p->reward;
cout<<'\n';
return OK;
}
p=p->next;
}
}
int Menu(LinkList &S)
{
int sign=1;
while(sign)
{
int i;
cout<<"请选择要进行的操作:1:插入 2:删除 3:输出 4:查找 5:排序 6:修改 0:退出"<<endl;
cin>>i;
if(i==1)
{ if(InputInfo(S))
cout<<"操作成功!"<<endl;
cout<<'\n';
}
else if(i==2)
{
char num[20];
cout<<"请输入要删除的职工编号:"<<endl;
cin>>num; if(DeleteByCode(S,num))
cout<<"操作成功!"<<endl; else
{
cout<<"此编号不存在!"<<endl;
cout<<'\n';
}
}
else if(i==3)
DisplayInfo(S);
else if(i==4)
{
int tag;
cout<<"1:按编号查找 2:按姓名查找 "<<endl;
cin>>tag;
if(!Search(S,tag))
cout<<"未找到!"<<endl;
cout<<'\n'; }
else if(i==5)
{

if(Sort(S));
cout<<"操作成功!"<<endl;
cout<<'\n';
}
else if(i==6)
{
if(change(S))
cout<<"修改成功!"<<endl;
} else if(i==0)
sign=0;
else
cout<<"输入有误,请重新输入!"<<endl;
cout<<'\n';
}
return OK;
}
int main()
{
LinkList S;
initlist(S);
Menu(S);
return OK;} 已经调试无bug 有问题的话联系我。

‘捌’ C语言设计 工资管理系统

没人做的话,我可以帮你试试 做好加加分神马的~

‘玖’ 工资管理系统C语言

代码还没有完善好,实在没时间了,最近太忙。先给你吧

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int addmenu();
int menu();

typedef struct teacher{
char name[32];
char unit[32];
float salary;
float allowance;
float tax;
float total;
struct teacher *next;
}TEACHER; //节点的结构体,包含数据和指针.

TEACHER *head;//头节点

void init() //初始化头节点
{
head=(TEACHER *)malloc(sizeof(TEACHER));
head->next=NULL;
}

void add(TEACHER *nod) //添加节点
{

if(head->next==NULL){
head=nod;
}
else
{
nod->next=head->next;
head->next=nod;
}
}

TEACHER *search(char *s) //遍历整个链表并打印数据
{
TEACHER *nod=head;
while(nod->next !=NULL)//!循环到最后一个节点,有问题。。
{
if((!strcmp(nod->name,s)) || (!strcmp(nod->unit,s))){
printf("姓名:%s\n单位:%s\n基本工资:%f\n津贴:%f\n扣税:%f\n总工资:%f\n",nod->name,nod->unit,nod->salary,nod->allowance,nod->tax,nod->tax);
return nod;
}
nod++;
}
printf("未找到数据\n");
return NULL;
}

void modify(TEACHER *s)
{
char name[16],unit[16];
float salary,allowance,tax,total;
gets(name);
strcpy(s->name,name);

gets(unit);
strcpy(s->unit,unit);

scanf("%f",&salary);
s->salary=salary;
scanf("%f",&allowance);
s->allowance=allowance;
scanf("%f",&tax);
s->tax=tax;
scanf("%f",&total);
s->total=total;

}

void del(char *s)
{
TEACHER *nod=head;
while(nod->next !=NULL)
{
if((!strcmp(nod->next->name,s))||(!strcmp(nod->next->unit,s))){
nod->next=nod->next->next;
nod->next=NULL;
}
}
}

int addmenu()//添加教师信息子菜单
{
TEACHER *node;
char command;
float salary,allowance,tax,total;
system("cls");
printf("****************************\n");
printf("* 添加子菜单 *\n");
printf("****************************\n");
printf("说明:4.返回主菜单 5.添加\n");
printf("请选择需要使用的功能:");
fflush(stdin);
while((command=getchar())!='4')
{
if(command==4)
break;
printf("添加信息:\n");
node=(TEACHER *)malloc(sizeof(TEACHER));
fflush(stdin);
printf("姓名:");
fflush(stdin);
gets(node->name);
printf("单位:");
fflush(stdin);
gets(node->unit);
printf("基本工资:");
fflush(stdin);
scanf("%f",&salary);
node->salary=salary;
printf("津贴:");
scanf("%f",&allowance);
node->allowance=allowance;
fflush(stdin);
printf("扣税:");
scanf("%f",&tax);
node->tax=tax;
fflush(stdin);
printf("总工资:");
scanf("%f",&total);
node->total=total;
fflush(stdin);
add(node);
fflush(stdin);
printf("输入c退出,其他字符继续\n");
if((command=getchar())=='c')
break;
}
return 0;
}

int save()
{
TEACHER *nod=head;
FILE *fp;
if((fp=fopen("teacher.txt","w+")) == NULL)
{
printf("打开文件异常\n");
return 0;
}
while(nod->next != NULL)
{
if(fwrite(nod,sizeof(TEACHER),1,fp)!=1){
printf("写入异常\n");
return 0;
}

nod++;
}

fclose(fp);
return 1;

}

int searchmenu()
{
char name[16];
char command;

system("cls");
printf("****************************\n");
printf("* 查询和修改子菜单 *\n");
printf("****************************\n");
printf("说明:4.返回主菜单 5.通过姓名/查找 6.修改 \n");
fflush(stdin);
printf("请输出需要实现的操作:");
while((command=getchar()) !='4')
{
switch(command)
{
case '4': break;
case '5':

printf("请输入需要查找的姓名:");
fflush(stdin);
gets(name);
search(name);
break;

// case '6': modify();break;
}
printf("请输出需要实现的操作:");
}

return 0;
}

int menu()
{

char command;
int i,j=10;
system("cls");

printf("****************************\n");
printf("* 工资管理系统 *\n");
printf("****************************\n");
printf("----------------------------\n");
printf("说明:1.添加 2.查询/修改 3.保存 4.退出\n");
printf("----------------------------\n");
printf("请输出需要实现的操作:");
while((command=getchar())!='4'){
switch(command)
{
case '1': addmenu(); break;
case '2': searchmenu();break;
case '3': i=save();if(i)printf("保存成功!\n"); while(j--);break;
}
fflush(stdin);
/*子函数退出后再次显示主界面*/
system("cls");
printf("****************************\n");
printf("* 工资管理系统 *\n");
printf("****************************\n");
printf("----------------------------\n");
printf("说明:1.添加 2.查询/修改 3.保存 4.退出\n");
printf("----------------------------\n");
printf("请输出需要实现的操作:");
}
printf("******感谢您使用本系统******\n");
return 0;
}

int main()
{
init();
menu();
return 0;
}

热点内容
开票人的权限配置如何选择 发布:2025-07-15 14:51:22 浏览:130
怎么把服务器变成普通电脑 发布:2025-07-15 14:39:45 浏览:957
甘肃天水首选服务器地址云主机 发布:2025-07-15 14:34:32 浏览:715
我的世界java版好玩的外国服务器网址 发布:2025-07-15 14:20:17 浏览:110
电脑的外存储器 发布:2025-07-15 14:19:42 浏览:526
淘淘源码 发布:2025-07-15 14:12:07 浏览:881
自己的主机可以搭建服务器吗 发布:2025-07-15 14:09:58 浏览:775
atilinux 发布:2025-07-15 14:01:42 浏览:822
硬盘缓存越大越好 发布:2025-07-15 13:53:22 浏览:388
苹果六怎么设置密码锁 发布:2025-07-15 13:43:28 浏览:33