C++实现学生信息管理系统

利用线性链表实现学生成绩管理系统,具体功能:输入、输出、插入、删除、查找、追加、读入、显示、保存、拷贝、排序、索引、分类合计、退出,并能在屏幕上输出操作前后的结果。
1. 写出系统需求分析,并建模。
2. 编程实现,界面友好。
3. 输出操作前后的结果
1.头文件

#define MAX_NUM 10
#include <String>
#include <fstream>
using namespace std;

bool quit = false;

struct StuNode{
    int num;
    int math, eng, yuwen;
    int sum;
    StuNode *nextstu;
};

class SInfo{
    StuNode *StuListHead;
public:
    SInfo();      //构造函数
    ~SInfo();     //析构函数
    void CreatSinfo();  //创建学生信息
    void StuInsert(int snum, int smath, int seng, int syuwen);  //插入学生信息
    void StuDelete(int snum);    //删除学生信息
    StuNode *StuFind(int snum);   //查找学生信息,传入参数学号
    void StuModify(int snum, int smath, int seng, int syuwen);   //修改学生信息
    void StuCopy(StuNode *ptemp, StuNode *p);  //学生信息拷贝
    void StuSort(char ch);
    void StuClassfy();     //分类合计
    void StuRead();        //从文件读入学生信息
    void StuSave();        //保存学生信息到文件
    int IsRead();
    void StuQuit();
    void ShowInfo();           //遍历输出学生信息


};

int Systemdoor()
{
    string username = "Hecoz", password = "password";
    string name, temp;
    int number = 3;
    while (1)
    {
        cout << "                用 户 名:";
        cin >> name;
        cout << "                密    码:";
        cin >> temp;
        if (name != username || temp != password)
        {
            number--;
            if (number >0)
            {
                cout << "          用户名/密码错误!你还有" << number << "次机会" << endl;
            }
            else
                cout << "用户名/密码错误!" << endl, exit(0);

        }
        else
        {
            cout << "********************密码正确********************" << endl<<endl;
            return 1;
        }
    }

}

void ShowMenu()
{
    cout << "********************************************" << endl;
    cout << "******     学  生  信  息  系  统    ******" << endl;
    cout << "******       0.安全退出系统          ******" << endl;
    cout << "******       1.文件读入学生信息      ******" << endl;
    cout << "******       2.录入新的学生信息      ******" << endl;
    cout << "******       3.添加新的学生信息      ******" << endl;
    
  • 31
    点赞
  • 182
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值