高校人事管理系统课程设计Word格式文档下载.docx
- 文档编号:19337674
- 上传时间:2023-01-05
- 格式:DOCX
- 页数:32
- 大小:64.37KB
高校人事管理系统课程设计Word格式文档下载.docx
《高校人事管理系统课程设计Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《高校人事管理系统课程设计Word格式文档下载.docx(32页珍藏版)》请在冰豆网上搜索。
charsex[10];
//性别
intage;
//年龄
chartime[20];
//来院时间
charpos[20];
//职务
chartechpos[20];
//职称
charparty[20];
//党派
charstudy[30];
//最高学历
person*mynext;
//指针语
public:
person(intnnum,charntype[],charnname[],charnsex[],intnage,charntime[],charnpos[],charntechpos[],charnparty[],charnstudy[])
{
no=nnum;
strcpy(type,ntype);
//将ntype的值复制给type
strcpy(name,nname);
strcpy(sex,nsex);
age=nage;
strcpy(time,ntime);
strcpy(pos,npos);
strcpy(techpos,ntechpos);
strcpy(party,nparty);
strcpy(study,nstudy);
mynext=NULL;
}
person(intnnum,charntype[],charnname[],charnsex[],intnage,charntime[],
charnpos[],charntechpos[],charnparty[],charnstudy[],person*next)
//某高校,主要人员有:
在职人员(行政人员、教师、一般员工)、退休人员、返聘人员和临时工。
//现在,需要存储这些人员的人事档案信息:
编号、姓名、性别、年龄、职务、职称、政治面貌、最高学历、来院时间。
strcpy(type,ntype);
strcpy(name,nname);
mynext=next;
voidsetnext(person*next)
mynext=next;
person*getnext()
returnmynext;
intgetnum()
returnno;
char*getname()
returnname;
char*getsex()
returnsex;
char*getpos()
returnpos;
char*gettechpos()
returntechpos;
char*gettime()
returntime;
char*getparty()
returnparty;
char*getstudy()
returnstudy;
intgetage()
returnage;
voidgetag(intas)
age=as;
char*gettype()
returntype;
};
classSchool
person*myfirst;
intfirstnum;
School()//无参构造函数
myfirst=NULL;
//将指针置空
School(intnnu,charntyp[],charnnam[],charnse[],intnag,charntim[],charnpo[],charntechpo[],charnpart[],charnstud[])//有参构造函数
myfirst=newperson(nnu,ntyp,nnam,nse,nag,ntim,npo,ntechpo,npart,nstud);
//在信息最后添加新的信息
voidinsertatlast(intnnum,charntype[],charnname[],charnsex[],intnage,charntime[],charnpos[],charntechpos[],charnparty[],charnstudy[])
person*next=myfirst;
//定义对象指针并付初值
if(next==NULL)
myfirst=newperson(nnum,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy);
else
{
while(next->
getnext()!
=NULL)
next=next->
getnext();
next->
setnext(newperson(nnum,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy,next->
getnext()));
}
voidprintf(intr)//获取信息
intnage;
charntype[20],nname[20],nsex[20],ntime[20],npos[20],ntechpos[20],nparty[20],nstudy[20];
cout<
<
"
请输入编号为"
r<
的成员的信息"
endl;
cout<
输入职工分类码[行政人员,教师,一般员工,退休人员,返聘人员,临时工]:
cin>
>
ntype;
输入姓名:
nname;
输入性别:
nsex;
输入年龄:
nage;
输入来院时间:
ntime;
输入职务[无,科级,处级,地级]:
npos;
输入职称[无,初级,中级,高级]:
ntechpos;
输入加入党派[群众,中共党员,民主党派]:
nparty;
输入学历[小学,初中,高中,大专,大学,硕士,博士]:
nstudy;
insertatlast(r,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy);
voidprintf1(person*ahead)//输出信息
编号:
setiosflags(ios:
:
left)<
setw(26)<
ahead->
getnum()<
姓名:
getname()<
性别:
getsex()<
年龄:
getage()<
职工类型:
setw(22)<
gettype()<
职务:
getpos()<
职称:
gettechpos()<
学历:
getstudy()<
政治面貌:
getparty()<
来院时间:
gettime()<
voidprintf()
person*ahead=myfirst;
编号---姓名---性别---年龄---职工类型---职务---职称---学历---政治面貌---来院时间\n"
while(ahead!
=NULL){cout<
setw(4)<
setw(6)<
getname();
setw(5)<
getage();
cout<
setw(10)<
getpos();
getstudy();
setw(9)<
setw(12)<
ahead=ahead->
voidadd()//添加新信息
inti,a,b;
person*p1=myfirst;
if(p1==NULL)
cout<
请输入编号:
;
i;
printf(i);
if(p1->
getnext()==NULL)//如果p1的后继指针为空,则执行“printf(a)”
{
a=p1->
getnum()+1;
printf(a);
}
else
while(p1->
=NULL)//p1的后继指针不为空,则执行“printf(b)”
{
p1=p1->
}
b=p1->
printf(b);
boolremovedatnum()//删除信息
intbh;
person*ahead=myfirst;
person*follow=ahead;
请输入要删除人员的编号:
bh;
if(ahead==NULL)
returnfalse;
if(ahead->
getnum()==bh)
myfirst=myfirst->
cout<
编号为"
bh<
的成员以被删除"
deleteahead;
returntrue;
ahead=ahead->
while(ahead!
if(ahead->
{
follow->
setnext(ahead->
getnext());
cout<
的成员以被删除\n"
deleteahead;
returntrue;
}
follow=ahead;
ahead=ahead->
要删除的成员不存在!
returnfalse;
boolfind1()//按编号查找
intid;
id;
**********************************"
无人员信息!
while(ahead!
if(ahead->
getnum()==id)
printf1(ahead);
else
无此人信息:
boolfind2()//按姓名查找
charnm[20];
输入姓名"
nm;
无人员信息"
if(strcmp(ahead->
getname(),nm)==0)
查无此人:
boolupperson()//修改信息
intiid;
请输入要修改人员的编号:
iid;
getnum()==iid)
intnu=-1;
for(inti=1;
nu!
=0;
i++)
intml;
intmll;
charty[30];
cout<
请选择要修改的内容:
1:
姓名2:
性别3:
年龄4:
职工类型5:
职务"
6:
职称7:
学历8:
政治面貌9:
来院时间"
选择(1-10):
ml;
switch(ml)
{
case1:
{
cout<
请输入姓名:
cin>
ty;
strcpy(follow->
getname(),ty);
};
break;
case2:
请输入性别:
strcpy(ahead->
getsex(),ty);
case3:
请输入年龄:
mll;
ahead->
getag(mll);
case4:
请输入职工类型:
gettype(),ty);
break;
case5:
请输入职务:
getpos(),ty);
case6:
请输入职称:
strcpy(ahead->
gettechpos(),ty);
case7:
请输入学历:
getstudy(),ty);
case8:
请输入政治面貌:
strcpy(ahead->
getparty(),ty);
case9:
请输入来院时间:
gettime(),ty);
}
returntrue;
没有此人"
voidload()
intnnum,nage;
ifstreamfperson;
fperson.open("
person.txt"
ios:
in);
while(fperson.good())
fperson>
nnum>
ntype>
nname>
nsex>
nage>
ntime>
npos>
ntechpos>
nparty>
insertatlast(nnum,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy);
fperson.close();
\n人员和相关数据已经装入.....\n"
voidsave()//保存文件到文件中
ofstreamfperson;
out);
person*p=myfirst;
while(p)
fperson<
p->
\t"
p=p->
保存数据已经完成"
~School()//析构函数,删除各指针!
{person*next=myfirst,*temp;
while(next!
temp=next;
next=next->
deletetemp;
myfirst=NULL;
voidmain()
Schools;
//定义对象
intc;
do
**************************************************"
高校人事管理系统"
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 高校 人事管理系统 课程设计
