c++信息管理系统

本文介绍了一个使用C++编写的教师信息管理系统,通过控制台操作,利用链表存储数据。系统包括教师信息的增删改查以及排序功能。在开发过程中遇到了文件读取的错误,经过调试已修复。该程序在VS Code中编写,用VC6.0编译,作者计划未来使用QT开发图形界面版本。
摘要由CSDN通过智能技术生成

信息管理系统
因为学校布置了写一个信息管理系统的作业,所以写下了这个信息管理系统,这是用cpp写的一个简单程序。
基本思路是通过控制台程序,然后通过数字命令来进行操作。
该程序编译了多文件;
因为是学校的作业所以我把万能头换成了
#include"stdc++.h"
功能和万能头一致。

该系统使用了链表来链接各个数据。
程序的基本功能是打算写两个系统,输入1和账号密码进入学生管理系统
输入2和账号密码进入教师管理系统
但是我只写了教师管理系统,因为这是学校的作业,而且之前我有写过学生管理系统了,所以没打算再写一次,以后有时间再说。
进入教师管理系统以后 :
输入1:用户自己增加教师信息
输入2:用户可以通过教师工号更改教师的姓名或身份证号或年龄或教师工号或者工资或者执教课程或课程学分。
输入3:通过教师工号来删除特定教师
输入4:显示所有的教师信息
输入5:从指定文件(D:\1808190126许达峰\Data.txt)读入信息。
输入6:显示符合某个特定信息的教师,可以用教师姓名、身份证、工号、工资、年龄、执教课程进行检索
输入7:可以通过教师工号、工资、年龄进行排序(从小到大)
输入0:退出系统。
主程序代码如下:

#include"stdc++.h"
#include"interface.h"
#include"actions.h"
#include"teacherMessage.h"
#include<stdlib.h>
using namespace std;

int main(){
	system("color 0F");
	//信息管理系统选项
	tasks();
	return 0;
}


这里包括了万能头、界面样式、用户操作、教师类定义四个头文件。
万能头文件如下:

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

界面样式代码如下:
.h文件代码:

#ifndef INTERFACE
#define INTERFACE

#include"stdc++.h"
using namespace std;
//教师信息管理系统界面样式
void MainFace();
//信息管理系统界面样式
void outFace();


#endif INTERFACE

.cpp文件代码:

#include"interface.h"
//教师信息管理系统界面样式
void MainFace(){
    cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
    cout<<"                                  "<<"-------------       欢迎进入教师信息管理系统      -------------"<<endl;
    cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
    cout<<"                                  "<<"---- 1.添加教师信息       ---------- 2.更改一位教师信息 -------"<<endl;
    cout<<"                                  "<<"---- 3.删除教师信息       ---------- 4.显示所有教师信息 -------"<<endl;
    cout<<"                                  "<<"---- 5.从文件录入教师信息 ---------- 6.显示教师信息     -------"<<endl;
    cout<<"                                  "<<"---- 7.对教师信息进行排序 ---------- 0.退出当前界面     -------"<<endl;
	cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
}
//信息管理系统界面样式
void outFace(){
	cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
    cout<<"                                  "<<"------------          欢迎进入信息管理系统      ---------------"<<endl;
    cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
    cout<<"                                  "<<"---- 1.学生登入          --------         2.教师登入 ----------"<<endl;
	cout<<"                                  "<<"---- 3.关于              --------         0.退出系统 ----------"<<endl;
	cout<<"                                  "<<"---------------------------------------------------------------"<<endl;
	cout<<"                                  "<<"测试使用的教师账号:teacher 密码:123456789                    "<<endl;
}

用户操作代码如下:
.h文件

#ifndef ACTIONS
#define ACTIONS

#include"stdc++.h"
#include"teacherMessage.h"

using namespace std;

typedef struct teacherDate * List;
typedef struct teacherDate Data;

//链表的构成元素
struct teacherDate
{
    Teacher self;
    List next;
};

//教师信息管理系统选项
void acts();
//主界面选项
void tasks();

#endif

.cpp文件

#include"actions.h"
#include"interface.h"
#include"teacherSystem.h"
#include <windows.h>

//账号密码
const string R_Id="teacher";
const string R_password="123456789";

//主界面选项
void tasks(){
    int task;
    outFace();
    cout<<"请输入0-2:"; 
    while(cin>>task){
        if(task==0){
			cout<<"拜拜"<<endl;
			Sleep(1000);
            break;
        }else if (task==1){
			//学生信息管理系统
            cout<<"该功能暂未开放,
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值