高校人员信息管理系统

  • 需求分析
  • 实现功能如下:
  • 系统环境:
  • 数据结构设计:
  • 界面显示:
  • 代码如下:
  • 下载链接

需求分析

该系统所应包含的信息有以下一些:
人员的基本信息:
编号、姓名、年龄、性别、职称等。

实现功能如下:

各种基本数据的录入。
各种基本数据的修改。即:允许对已经录入的数据重新进行编辑、修改。
例如修改信息栏中张三的基本信息
各种基本数据的删除。例如将张三的信息从信息栏中删除
基于各种数据的查询。
基于各种数据的统计。
数据导出:将信息栏中信息导出到指定文件。
数据导入:从指定文件导入信息到信息栏中。

系统环境:

采用C++语言实现,开发环境为Microsoft Visual Studio 2010,可以运行在操作系统windows10。

数据结构设计:

界面显示:


代码如下:

#include "stdafx.h"
#include "teacher.h"
#include "tea.h"
#include "test.h"
#include "po.h"
//教师管理界面
void tea1(tea TEA)
{int b,v=Tea3;char c;do{cout<<"教师管理界面"<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"1.添加    ";cout<<"2.查询    ";cout<<"3.显示    ";cout<<"4.编辑    ";cout<<"5.删除    ";cout<<"6.统计    ";cout<<"7.保存    ";cout<<"8.读取    ";cout<<"0.退出    "<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"请选择:";cin>>b;switch(b){case 1:TEA.Add(v);system("pause");break;case 2:TEA.Search();system("pause");break;case 3:TEA.Show();system("pause");break;case 4:TEA.Edit();system("pause");break;case 5:TEA.Delete(v);system("pause");break;case 6:cout<<"共有教师人数:"<<v<<endl;system("pause");break;case 7:TEA.Save();system("pause");break;case 8:TEA.Read(v);system("pause");break;default:cout<<"\n 错误!"<<endl;system("pause");break;case 0:break;}cin.clear();c=getchar();system("cls");}while(b!=0);
}
//实验员管理界面
void test1(test TES)
{int b,v=Testop;char c;do{cout<<"实验员管理界面"<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"1.添加    ";cout<<"2.查询    ";cout<<"3.显示    ";cout<<"4.编辑    ";cout<<"5.删除    ";cout<<"6.统计    ";cout<<"7.保存    ";cout<<"8.读取    ";cout<<"0.退出    "<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"请选择:";cin>>b;switch(b){case 1:TES.Add(v);system("pause");break;case 2:TES.Search();system("pause");break;case 3:TES.Show();system("pause");break;case 4:TES.Edit();system("pause");break;case 5:TES.Delete(v);system("pause");break;case 6:cout<<"共有实验员人数:"<<v<<endl;system("pause");break;case 7:TES.Save();system("pause");break;case 8:TES.Read(v);system("pause");break;default:cout<<"\n错误!"<<endl;system("pause");break;case 0:break;}cout<<"按回车键返回"<<endl;cin.clear();c=getchar();system("cls");}while(b!=0);
}
//行政人员管理界面
void po1(po PO)
{int b,v=Policersop;char c;do{cout<<"行政人员管理界面"<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"1.添加    ";cout<<"2.查询    ";cout<<"3.显示    ";cout<<"4.编辑    ";cout<<"5.删除    ";cout<<"6.统计    ";cout<<"7.保存    ";cout<<"8.读取    ";cout<<"0.退出    "<<endl;cout<<"________________________________________________________________________________"<<endl;cout<<"请选择:";cin>>b;switch(b){case 1:PO.Add(v);system("pause");break;case 2:PO.Search();system("pause");break;case 3:PO.Show();system("pause");break;case 4:PO.Edit();system("pause");break;case 5:PO.Delete(v);system("pause");break;case 6:cout<<"共有行政员人数:"<<v<<endl;system("pause");break;case 7:PO.Save();system("pause");break;case 8:PO.Read(v);system("pause");break;default:cout<<"\n 错误!"<<endl;system("pause");break;case 0:break;}cin.clear();c=getchar();system("cls");}while(b!=0);
}
//主函数
int main()
{   tea tea2;test tes2;po po2;int a;char c;while(1){system("cls");cout<<endl;cout<<"              ****欢迎使用高校人员信息管理系统**** "<<endl;cout<<" \n\n\n"<<endl;cout<<"                     1.教师管理                    "<<endl;cout<<"                     2.实验员管理                  "<<endl;cout<<"                     3.行政员管理                  "<<endl;cout<<"                     0.退出                        "<<endl;cout<<"\n\n\n"<<endl;cout<<"请选择:";cin>>a;    switch(a){case 1:system("cls");tea1(tea2);break;case 2:system("cls");test1(tes2);break;case 3:system("cls");po1(po2);break;case 0:exit(0);break;default:cout<<"\n 错误!"<<endl;system("pause");c=getchar();cin.clear();  break;}}return 0;}

以下是类:
persion.h

#include<fstream>
#include<iostream>
#include<string>
using namespace std;
static int Tea3;
static int Testop;
static int Policersop;
#define z 666
class person
{
public:int num;string name;string sex;int age;
};

tester.h

#include "person.h"
class tester :virtual public person
{
public:string testroom;string post;void Input(){cout<<"请再次输入编号以确定:";cin>>num;cout<<"请输入姓名:";cin>>name;cout<<"请输入性别:";cin>>sex;cout<<"请输入年龄:";cin>>age;cout<<"请输入该实验员所在实验室:";cin>>testroom;cout<<"请输入该实验员的职务:";cin>>post;}void Output(){cout<<"编号: "<<num<<"  "<<"姓名: "<<name<<"  "<<"性别: "<<sex<<"  "<<"年龄: "<<age<<"  "<<"所在实验室: "<<testroom<<"  "<<"职务: "<<post<<endl;}};

policer.h

#include "person.h"
class policer :virtual public person
{
public:string polices;string post1;void Input(){cout<<"请再次输入编号以确定:";cin>>num;cout<<"请输入姓名:";cin>>name;cout<<"请输入性别:";cin>>sex;cout<<"请输入年龄:";cin>>age;cout<<"请输入政治面貌:";cin>>polices;cout<<"请输入职称:";cin>>post1;}void Output(){cout<<"编号: "<<num<<"  "<<"姓名: "<<name<<"  "<<"性别: "<<sex<<"  "<<"年龄: "<<age<<"  "<<"政治面貌: "<<polices<<"  "<<"职称: "<<post1<<endl;}};

teacher.h

#include "person.h"
class teacher :virtual public person
{
public:string dept;string special;string title;void Input(){cout<<"请再次输入编号以确定:";cin>>num;cout<<"请输入姓名:";cin>>name;cout<<"请输入性别:";cin>>sex;cout<<"请输入年龄:";cin>>age;cout<<"请输入该教师所在系别:";cin>>dept;cout<<"请输入该教师专业:";cin>>special;cout<<"请输入该教师的职称:";cin>>title;}void Output(){cout<<"编号: "<<num<<"  "<<"姓名: "<<name<<"  "<<"性别: "<<sex<<"  "<<"年龄: "<<age<<"  "<<"所在系: "<<dept<<"  "<<"专业: "<<special<<"  "<<"职称: "<<title<<endl;}
};

方法类:

po.h

#include "policer.h"
class po
{
public:policer Po[z];int Add(int &w);int Search();void Show();void Edit();int Delete(int &w);void Save();int Read(int &w);};

po.cpp

#include "StdAfx.h"
#include "po.h"
int po::Add(int &w)
{policer t;int i,nu;if(Policersop==z) {cout<<"人数已满"<<endl;return 0;}cout<<"请输入编号:";cin>>nu;for(i=0;i<Policersop;i++){if(nu==Po[i].num){cout<<"已有编号,请重新输入"<<endl;return 0;}}t.Input();Po[Policersop]=t;Policersop++;w=Policersop;cout<<"添加成功!"<<endl;return 1;
}
int po::Search()
{int j,n;cout<<"请输入编号:";cin>>n;for(j=0;j<Policersop;j++){if(n==Po[j].num) break;}if(j==Policersop)cout<<"没有此人!"<<endl;elsePo[j].Output();return 1;
}
void po::Show()
{int i;if(Policersop==0){cout<<"记录为空!"<<endl; return;}for(i=0;i<Policersop;i++)Po[i].Output();
}
void po::Edit()
{policer t1;int j,n;cout<<"请输入要编辑的人的编号:";cin>>n;for(j=0;j<Policersop;j++){if(n==Po[j].num) break;}if(j==Policersop){cout<<"没有此人!"<<endl;return;};cout<<"输入修改后的信息,编号不能改:"<<endl;t1.Input();Po[j]=t1;cout<<"编辑成功!"<<endl;
}
int po::Delete(int &w)
{int j,n;cout<<"请输入要删除的人的编号:";cin>>n;for(j=0;j<Policersop;j++){if(n==Po[j].num) break;}if(j==Policersop){cout<<"没有此人!"<<endl;return 0;};for(j;j<Policersop;j++){Po[j]=Po[j+1];}Policersop--;w=Policersop;cout<<"删除成功!"<<endl;return 1;
}
void po::Save()
{int i;ofstream outfile,outfile1;   outfile1.open("Policersop.dat",ios::out);outfile1<<Policersop;outfile.open("Policers_data.dat",ios::out);   if(!outfile){cerr<<"没有此文件!"<<endl; return; }for(i=0;i<Policersop;i++){outfile<<Po[i].num<<endl;outfile<<Po[i].name<<endl;outfile<<Po[i].sex<<endl;outfile<<Po[i].age<<endl;outfile<<Po[i].polices<<endl;outfile<<Po[i].post1<<endl;}outfile.close();   cout<<"保存成功!"<<endl;
}
int po::Read(int &w)
{w=0;int i;ifstream infile,infile1; infile1.open("Policersop.dat",ios::in);infile1>>Policersop;w=Policersop;infile.open("Policers_data.dat",ios::in);   if(!infile){cerr<<"没有此文件!"<<endl; return 1; }for(i=0;i<Policersop;i++){ infile>>Po[i].num;infile>>Po[i].name;infile>>Po[i].sex;infile>>Po[i].age;infile>>Po[i].polices;infile>>Po[i].post1;}infile.close();  cout<<"读取成功!"<<endl;return 0;
}

tea.h

#include "teacher.h"class tea
{public:teacher Tea[z];int Add(int &w);int Search();void Show();void Edit();int Delete(int &w);void Save();int Read(int &w);tea(void);~tea(void);
};

tea.cpp


#include "StdAfx.h"
#include "tea.h"
int tea::Add(int &w)
{teacher t;int i,nu;if(Tea3==z) {cout<<"人数已满"<<endl;return 0;}cout<<"请输入编号:";cin>>nu;for(i=0;i<Tea3;i++){if(nu==Tea[i].num){cout<<"已有编号,请重新输入"<<endl;return 0;}}t.Input();Tea[Tea3]=t;Tea3++;w=Tea3;cout<<"添加成功!"<<endl;return 1;
}
int tea::Search()
{int j,n;cout<<"请输入编号:";cin>>n;for(j=0;j<Tea3;j++){if(n==Tea[j].num) break;}if(j==Tea3)cout<<"没有此人!"<<endl;elseTea[j].Output();return 1;
}
void tea::Show()
{int i;if(Tea3==0){cout<<"记录为空!"<<endl; return;}for(i=0;i<Tea3;i++)Tea[i].Output();
}
void tea::Edit()
{teacher t1;int j,n;cout<<"请输入要编辑的人的编号:";cin>>n;for(j=0;j<Tea3;j++){if(n==Tea[j].num) break;}if(j==Tea3){cout<<"没有此人!"<<endl;return;};cout<<"输入修改后的信息,编号不能改:"<<endl;t1.Input();Tea[j]=t1;cout<<"编辑成功!"<<endl;
}
int tea::Delete(int &w)
{int j,n;cout<<"请输入要删除的人的编号:";cin>>n;for(j=0;j<Tea3;j++){if(n==Tea[j].num) break;}if(j==Tea3){cout<<"没有此人!"<<endl;return 0;};for(j;j<Tea3;j++){Tea[j]=Tea[j+1];}Tea3--;w=Tea3;cout<<"删除成功!"<<endl;return 1;
}
void tea::Save()
{int i;ofstream outfile,outfile1;   outfile1.open("Tea3.dat",ios::out);outfile1<<Tea3;outfile.open("Tea_data.dat",ios::out);   if(!outfile){cerr<<"没有此文件!"<<endl; return; }for(i=0;i<Tea3;i++){outfile<<Tea[i].num<<endl;outfile<<Tea[i].name<<endl;outfile<<Tea[i].sex<<endl;outfile<<Tea[i].age<<endl;   outfile<<Tea[i].dept<<endl;    outfile<<Tea[i].special<<endl;outfile<<Tea[i].title<<endl;}outfile.close();   cout<<"保存成功!"<<endl;
}
int tea::Read(int &w)
{w=0;int i;ifstream infile,infile1; infile1.open("Tea3.dat",ios::in);infile1>>Tea3;w=Tea3;infile.open("Tea_data.dat",ios::in);   if(!infile){cerr<<"没有此文件!"<<endl; return 0; }for(i=0;i<Tea3;i++){ infile>>Tea[i].num;infile>>Tea[i].name;infile>>Tea[i].sex;infile>>Tea[i].age;infile>>Tea[i].dept;infile>>Tea[i].special;infile>>Tea[i].title;}infile.close();  cout<<"读取成功!"<<endl;return 0;
} tea::tea(void)
{
}tea::~tea(void)
{
}

test.h

#include "tester.h"
class test
{
public:tester Test[z];int Add(int &w);int Search();void Show();void Edit();int Delete(int &w);void Save();int Read(int &w);};

test.cpp

#include "StdAfx.h"
#include "test.h"
int test::Add(int &w)
{tester t;int i,nu;if(Testop==z) {cout<<"人数已满"<<endl;return 0;}cout<<"请输入编号:";cin>>nu;for(i=0;i<Testop;i++){if(nu==Test[i].num){cout<<"已有编号,请重新输入"<<endl;return 0;}}t.Input();Test[Testop]=t;Testop++;w=Testop;cout<<"添加成功!"<<endl;return 1;
}
int test::Search()
{int j,n;cout<<"请输入编号:";cin>>n;for(j=0;j<Testop;j++){if(n==Test[j].num) break;}if(j==Testop)cout<<"没有此人!"<<endl;elseTest[j].Output();return 1;
}
void test::Show()
{int i;if(Testop==0){cout<<"记录为空!"<<endl; return;}for(i=0;i<Testop;i++)Test[i].Output();
}
void test::Edit()
{tester t1;int j,n;cout<<"请输入要编辑的人的编号:";cin>>n;for(j=0;j<Testop;j++){if(n==Test[j].num) break;}if(j==Testop){cout<<"没有此人!"<<endl;return;};cout<<"输入修改后的信息,编号不能改:"<<endl;t1.Input();Test[j]=t1;cout<<"编辑成功!"<<endl;
}
int test::Delete(int &w)
{int j,n;cout<<"请输入要删除的人的编号:";cin>>n;for(j=0;j<Testop;j++){if(n==Test[j].num) break;}if(j==Testop){cout<<"没有此人!"<<endl;return 0;};for(j;j<Testop;j++){Test[j]=Test[j+1];}Testop--;w=Testop;cout<<"删除成功!"<<endl;return 1;
}
void test::Save()
{int i;ofstream outfile,outfile1;   outfile1.open("Test.dat",ios::out);outfile1<<Testop;outfile.open("Test_data.dat",ios::out);   if(!outfile){cerr<<"没有此文件!"<<endl; return; }for(i=0;i<Testop;i++){outfile<<Test[i].num<<endl;outfile<<Test[i].name<<endl;outfile<<Test[i].sex<<endl;outfile<<Test[i].age<<endl;  outfile<<Test[i].testroom<<endl;   outfile<<Test[i].post<<endl;}outfile.close();   cout<<"保存成功!"<<endl;
}
int test::Read(int &w)
{int i;ifstream infile,infile1; infile1.open("Test.dat",ios::in);infile1>>Testop;w=Testop;infile.open("Test_data.dat",ios::in);   if(!infile){cerr<<"没有此文件!"<<endl; return 1; }for(i=0;i<Testop;i++){ infile>>Test[i].num;infile>>Test[i].name;infile>>Test[i].sex;infile>>Test[i].age;infile>>Test[i].testroom;infile>>Test[i].post;}infile.close();  cout<<"读取成功!"<<endl;return 0;
}

下载链接

仅供学习参考,文件下载链接C++实现高校人员信息管理系统

课程设计下:利用C++实现高校人员信息管理系统相关推荐

  1. 高校人员信息管理系统(C++版)

    目录 高校人员信息管理系统 一.问题描述 二.功能要求 三.问题的解决方案 四.代码段 1.多文件 2.单文件                                  高校人员信息管理系统  ...

  2. C++课程设计实训_基于多态书籍信息管理系统的设计与实现、附源码、有过程截图

    C++课程设计实训_基于多态书籍信息管理系统的设计与实现.附源码,有过程截图 书籍信息管理系统的设计与实现(基于多态) 学生姓名: 学 号: 指导老师: 所 在 系: 专 业: 班 级: C++课程设 ...

  3. c++课设:高校人员信息管理系统 开发一个简易的高校人员信息管理系统,主要针对高校人员的基本信息进行管理。采用对象链表或对象数组存放各个对象,实现新增、修改、删除、查询以及统计等功能。

    通过本次课程设计,深入理解类和对象.继承和派生.重载和多态,熟练掌握面向对象的程序设计思想和方法,能够对现实世界中的实际问题进行分析.设计,并学会熟练运用面向对象的编程方法(OOP)-- C++语言进 ...

  4. 高校人员信息管理系统(Python版)

    目录 高校人员信息管理系统 一.问题描述 二.功能要求 三.问题的解决方案 四.运行环境说明 五.代码段 1.多文件 (1)员工类(文件1) (2)教师类(文件2) (3)实验员类(文件3) (4)行 ...

  5. java高校人员信息管理系统

    高校人员信息管理系统 1.数据模型 教师.实验员.行政人员.教师兼行政人员 共有属性:编号.姓名.性别.出生年月 教师:所在系部.专业.职称 实验员:所在实验室.职称 行政人员:政治面貌.职务 pac ...

  6. 高校人员信息管理系统(C++课设)

    /* 高校人员信息管理系统 作者:徐世兴 时间:2019年11月1日 *///预定义区 #include<iostream> #include<string> #include ...

  7. 高校人员信息管理系统(Java课程设计,带图形界面版)

    题目 1.问题描述 某高校有四类员工:教师.实验员.行政人员,教师兼行政人员:共有的信息包括:编号.姓名.性别.年龄等.其中,教师还包含的信息有:所在系部.专业.职称:实验员还包含的信息由:所在实验室 ...

  8. C语言课程设计不会做?其实各种信息管理系统都一样!

    C语言课程设计示例:歌曲信息管理系统 前言:大家在学习C语言时,最终都会面临这个"大项目":课程设计,而知识的整合与庞大的代码量总会让许多初学者手足无措.还记得我当时的课程设计,真 ...

  9. c语言高校信息查询系统,高校人员信息管理系统c语言.doc

    #include #include #include #include #include using namespace std; class Person //基类 { protected: dou ...

最新文章

  1. jquery源码--jquery对象
  2. sqlite 统计每张表的记录数_Excel单页式人事管理表,档案记录,自带查询统计,简单实用...
  3. 4.5-4.9 磁盘格式化,磁盘挂载,手动增加swap空间
  4. esxi6.7虚拟机网卡连接第二个虚拟交换机_Linux云计算底层技术之网络虚拟化
  5. fastjson字段改名/设置别名
  6. iOS 打包.framework(包括第三方、图片、xib、plist文件)详细步骤及需要注意的地方...
  7. Go原子操作 sync/atomic
  8. idea导包都报错_不仅仅要会导别人的包也要会导自定义的包——Python导包总结...
  9. (笔记)电路设计(六)之稳压二极管的应用
  10. LiveLinkFce的Arkit与Character Creator动画曲线的对接
  11. Unity获得汉字拼音或首字母
  12. lintcode刷题目录
  13. HttpClient 4 和 HttpClient 3 设置超时
  14. vscode格式化代码设置
  15. 麒麟座v1.4开发板01-资料获取
  16. 计算机的顶会有哪些?
  17. Opegnl ES之四边形绘制
  18. Oracle EBS财务模块(一)基本功能
  19. 服务器是什么?跟电脑有啥区别?
  20. 怎么判断机械表上满弦_腕表冷知识,知道两个以上算我输!

热门文章

  1. js获取元素绝对坐标
  2. mysql数据库主键的思考
  3. 策略模式(Strategy 模式)
  4. timthumb.php下载,timthumb.php
  5. vue3基础-响应式 API 之 unref、toRef、toRefs、isRef
  6. 2014年07月14日
  7. 2023.1.4单词打卡
  8. 2021年1月25日博客日记
  9. 达梦数据库查询与操作
  10. WAVECOM AT命令集