学生信息管理系统的设计与实现

目录

1    引言

1.1 设计目标

1.2 功能需求

1.学籍信息管理

 2.成绩信息管理

1.3 信息描述

1.4 功能描述

1.学生信息管理系统

2.学籍信息管理

3.成绩信息管理

2    总体设计

2.1  程序功能结构图

2.2  系统功能设计

3    详细设计

3.1 学生信息管理系统

3.2 学籍信息管理功能

3.3 成绩信息管理功能

3.4 学生类

4    测试与总结

4.1 测试和调试

4.2 收获及心得体会



1    引言

1.1 设计目标

在Visual Studio 2022集成开发环境中开发学生信息管理系统。用户可以通过程序实现两大主功能,分别为学籍信息管理,成绩信息管理。程序分成三个不同功能界面,主界面、学籍信息管理界面、成绩信息管理界面。其下分别有若干模块功能共同实现学生信息管理系统。

1.2 功能需求

1.学籍信息管理

(1)输入功能:学生信息通过文件录入,并用文件保存。

(2)浏览功能:完成对全部学生信息的显示。

(3)查找功能:

①完成按学生的学号查询学生的相关信息,并显示。

②完成按学生的电话号码查询学生的相关信息,并显示。

③完成按学生的姓名查询学生的相关信息,并显示,允许重名。

(4)删除功能:通过输入学生的姓名完成对该名学生的信息进行删除。

(5)添加功能:完成添加新学生的学籍信息的任务。

(6)修改功能:通过输入学生的姓名完成对该名学生的信息进行修改。

 2.成绩信息管理

(1)录入每个学生的学号、姓名和各科考试成绩。

(2)计算每门课程的总分和平均分。

(3)计算每个学生的总分和平均分。

(4)按每个学生的总分由高到低排出名次表。

(5)按学号由小到大排出成绩表。

(6)按学号查询学生排名及其考试成绩。

(7)按姓名查询学生排名及其考试成绩。

(8)查询语文最高分的学生学籍信息。

(9)查询总成绩排名前三的学生的学籍信息和总分。

1.3 信息描述

学籍信息:学号、姓名、性别、年龄、电话、专业等(学号不重复)。

成绩信息:学号,姓名,专业,语文成绩,数学成绩,英语成绩。

1.4 功能描述

 图1-4  学生信息管理系统结构图

1.学生信息管理系统

  1. 学籍信息管理
  2. 成绩信息管理
  3. 退出系统

2.学籍信息管理

(0)返回主界面

(1)输入功能:学生信息可以在程序中输入对应文件名录入,并用将新录入的数据保存到存放数据的文件中。

(2)浏览功能:完成对全部学生学籍信息的显示。

(3)查找功能:

①用户按学生的学号查询学生的相关信息,并显示。

②用户按学生的电话号码查询学生的相关信息,并显示。

③用户按学生的姓名查询学生的相关信息,出现重名学生时将所有重名学生学籍信息显示。

(4)删除功能:通过输入学生的姓名完成对学生的信息进行删除,若有重名学生按照学号选择删除,并让用户决定是否继续删除。

(5)添加功能:用户手动键盘输入批量添加新学生的学籍信息。

(6)修改功能:通过输入学生的姓名完成对学生的信息进行修改,若有重名学生按照学号选择修改,并让用户决定是否继续修改。

3.成绩信息管理

(0)返回主界面

(1)录入功能:以外部文件的形式录入每个学生的学号、姓名和各科考试成绩。

(2)统计功能:计算每门课程的总分和平均分。

(3)统计功能:计算每个学生的总分和平均分。

(4)显示功能:用户选择排表方式

        ①按每个学生的总分由高到低排出名次表。

        ②按学号由小到大排出成绩表。

(5)查询功能:用户选择查询方式

        ①按学号查询学生排名及其考试成绩。

        ②按姓名查询学生排名及其考试成绩

        ③按姓名查询学生排名及其考试成绩。

        ④查询总成绩排名前三的学生的学籍信息和总分。


2    总体设计

2.1  程序功能结构图

图2-1.1  学籍信息管理功能以及实现函数

图2-1.2  成绩信息管理功能以及实现函数

2.2  系统功能设计

图2-2  系统设计结构图


3    详细设计

3.1 学生信息管理系统

Student_Manager.h

#pragma once
#include<iostream>
using namespace std;
class Student_Manager
{
public:
	//展示菜单
	void show_menu();
	//返回上一界面
	void Exitsystem();
};

Student_Manager.cpp

#include<iostream>
#include"Student.h"
#include"Student_Manager.h"
//展示菜单
void Student_Manager::show_menu()
{
	cout << "************************************************" << endl;
	cout << "*********** 欢迎使用学生信息管理系统 ***********" << endl;
	cout << "************** 0.退出学生信息系统 **************" << endl;
	cout << "************** 1.进入学籍管理系统 **************" << endl;
	cout << "************** 2.进入成绩管理系统 **************" << endl;
	cout << "************************************************" << endl;
	cout << endl;
}
//退出系统
void Student_Manager::Exitsystem()
{
	cout << "欢迎下次使用本系统" << endl;
	system("pause");
	exit(0);
}

student_system.cpp

#include<iostream>
#include"Student_Manager.h"
#include"Student_status_Manager.h"
#include"Student_grades_Manager.h"
using namespace std;
int main()
{
	Student_Manager sm;
	int choice1 = 0;
	while (true)
	{
		sm.show_menu();
		cout << "请输入你的选择: ";
		//判断是否为合法输入
		cin >> choice1;
		while ((!cin) || (choice1 != 0 && choice1 != 1 && choice1 != 2))
		{
			cin.clear();
			cin.ignore();
			cout << "输入有误,请重新输入" << endl;
			cin >> choice1;
		}
		if (choice1 == 0)
		{
			sm.Exitsystem();
		}
		else if (choice1 == 1)
		{
			//测试学籍管理主功能
			Student_status_Manager ssm;
			int choice2 = 0;
			bool flag1 = true;
			while (flag1)
			{
				system("cls");
				ssm.show_menu();
				cout << "请输入你的选择: ";
				cin >> choice2;
				switch (choice2)
				{
				case 0://返回上一界面
				{
					flag1 = false;
					cout << "已退出学籍管理界面" << endl;
					system("pause");
					break;
				}
				case 1://输入功能
					ssm.Input_Stu();
					break;
				case 2://显示学生
					ssm.Show_Stu();
					break;
				case 3://查找学生
					ssm.Find_Stu();
					break;
				case 4://删除学生
					ssm.Del_Stu();
					break;
				case 5://增加学生
					ssm.add_Stu();
					break;
				case 6://修改学生
					ssm.Mod_Stu();
					break;
				default:
					//非法输入刷新屏幕
					system("cls");
					break;
				}
			}
		}
		else if (choice1 == 2)
		{
			//测试成绩管理主功能
			Student_grades_Manager sgm;
			int choice3 = 0;
			bool flag2 = true;
			while (flag2)
			{
				system("cls");
				sgm.show_menu();
				cout << "请输入你的选择: ";
				cin >> choice3;
				switch (choice3)
				{
				case 0:	//返回上一界面
				{
					flag2 = false;
					cout << "已退出成绩管理界面" << endl;
					system("pause");
					break;
				}
				case 1://录入学生成绩
					sgm.Input_Stu();
					break;
				case 2://计算课程成绩
					sgm.Course_grades();
					break;
				case 3://计算学生成绩
					sgm.Ind_grades();
					break;
				case 4://依据总分排表//依据学号排表
					sgm.Sort_Stu();
					break;
				case 5://四种方式查询学生成绩
					sgm.Find_Stu();
					break;
				default://非法输入刷新屏幕
					system("cls");
					break;
				}
			}
		}
		system("cls");
	}
	return 0;
}

3.2 学籍信息管理功能

Student_status_Manager.h

#pragma once
#include<iostream>
#include"Student.h"
#include<fstream>
#include<string>
#define FILENAME1 "Stu_status_file.txt"
using namespace std;
class Student_status_Manager
{
public:
	//构造函数
	Student_status_Manager();
	//展示菜单
	void show_menu();
	//析构函数
	~Student_status_Manager();
	//增加学生
	void add_Stu();
	//保存到文件
	void save();
	//统计学生人数
	int get_StuNum();
	//初始化学生信息
	void init_Stu();
	//统计录入人数
	int fileStuNum(string filename);
	//录入学生数据
	void Input_Stu();
	//显示学生信息
	void Show_Stu();
	//删除学生信息
	void Del_Stu();
	//判断学生是否存在   函数重载
	//如果存在返回学生的位置,如果不存在返回-1
	int isExist1(int id);
	int isExist2(int phone);
	int isExist(string name);
	//修改学生信息
	void Mod_Stu();
	//查找学生
	void Find_Stu();
	//记录学生人数
	int m_StuNum;
	//学生数组指针
	Student** m_StuArray;
	//判断文件是否存在标志
	bool m_FileIsExist;
};

Student_status_Manager.cpp

#include"Student_status_Manager.h"
#include<iostream>
//构造函数
Student_status_Manager::Student_status_Manager()
{
	ifstream ifs;
	ifs.open(FILENAME1, ios::in);
	//1.文件不存在
	if (!ifs.is_open())
	{
		//初始化属性
		this->m_StuNum = 0;
		this->m_StuArray = NULL;
		this->m_FileIsExist = true;
		ifs.close();
	}
	//2.文件存在,数据为空
	char ch;
	ifs >> ch;
	if (ifs.eof())
	{
		//初始化属性
		this->m_StuNum = 0;
		this->m_StuArray = NULL;
		this->m_FileIsExist = true;
		ifs.close();
	}
	//3.文件存在,数据存在
	else
	{
		ifs.close();
		int num = this->get_StuNum();
		this->m_StuNum = num;
		//开辟空间
		this->m_StuArray = new Student * [this->m_StuNum];
		//将文件中的数据存到数组中
		this->init_Stu();
	}
}
//析构函数
Student_status_Manager::~Student_status_Manager()
{
	if (this->m_StuArray != NULL)
	{
		for (int i = 0; i < m_StuNum; i++)
		{
			if (this->m_StuArray[i] != NULL)
			{
				delete this->m_StuArray[i];
			}
		}
		delete[]this->m_StuArray;
		this->m_StuArray = NULL;
	}
}
//显示菜单
void Student_status_Manager::show_menu()
{
	cout << "********************************************" << endl;
	cout << "********* 欢迎使用学籍信息管理功能 *********" << endl;
	cout << "************** 0.返回上一界面 **************" << endl;
	cout << "************** 1.输入学生信息 **************" << endl;
	cout << "************** 2.浏览学生信息 **************" << endl;
	cout << "************** 3.查找学生信息 **************" << endl;
	cout << "************** 4.删除学生信息 **************" << endl;
	cout << "************** 5.增加学生信息 **************" << endl;
	cout << "************** 6.修改学生信息 **************" << endl;
	cout << "********************************************" << endl;
	cout << endl;
}
//添加学生
void Student_status_Manager::add_Stu()
{
	cout << "请输入添加学生人数:" << endl;
	//记录添加学生数
	int addnum = 0;
	cin >> addnum;
	if (addnum > 0)
	{
		//计算新空间的大小
		int newsize = this->m_StuNum + addnum;
		//开辟新空间
		Student** newspace = new Student * [newsize * sizeof(Student)];
		//将原空间下的数据拷贝到新空间
		if (this->m_StuArray != NULL)
		{
			for (int i = 0; i < this->m_StuNum; i++)
			{
				newspace[i] = this->m_StuArray[i];
			}
		}
		//批量添加新数据
		for (int i = 0; i < addnum; i++)
		{
			int id;
			string name;
			string sex;
			int age;
			int phone;
			string maj;
			cout << "请输入第" << i + 1 << "个新学生的学生学号" << endl;
			while (true)//判断是否有重复学号
			{
				cin >> id;
				if (this->isExist1(id) != -1)
				{
					cout << "学号重复,请重新输入" << endl;
				}
				else
				{
					break;
				}
			}
			cout << "请输入第" << i + 1 << "个新学生的学生姓名" << endl;
			cin >> name;
			cout << "请输入第" << i + 1 << "个新学生的学生性别" << endl;
			cin >> sex;
			cout << "请输入第" << i + 1 << "个新学生的学生年龄" << endl;
			cin >> age;
			cout << "请输入第" << i + 1 << "个新学生的学生电话" << endl;
			cin >> phone;
			cout << "请输入第" << i + 1 << "个新学生的学生专业" << endl;
			cin >> maj;
			Student* student = NULL;
			student = new Student(id, name, sex, age, phone, maj);
			//将学生指针保存到数组中
			newspace[this->m_StuNum + i] = student;
		}
		//释放原有空间
		delete[]this->m_StuArray;
		//更改新空间指向
		this->m_StuArray = newspace;
		//更新新的学生人数
		this->m_StuNum = newsize;
		//更新学生不为空的标志
		this->m_FileIsExist = false;
		//提示添加成功
		cout << "成功添加" << addnum << "名新学生" << endl;
		//添加成功后保存到文件中
		this->save();
		system("pause");
		system("cls");
	}
	else
	{
		cout << "输入数据有误" << endl;
	}
}
//保存文件
void Student_status_Manager::save()
{
	ofstream ofs;
	//打开文件,写入数据
	ofs.open(FILENAME1, ios::out);
	for (int i = 0; i < this->m_StuNum; i++)
	{
		//数据写入文件
		ofs << this->m_StuArray[i]->m_id
			<< " " << this->m_StuArray[i]->m_name
			<< " " << this->m_StuArray[i]->m_sex
			<< " " << this->m_StuArray[i]->m_age
			<< " " << this->m_StuArray[i]->m_phone
			<< " " << this->m_StuArray[i]->m_maj << endl;
	}
	ofs.close();
}
//统计已有学生人数
int Student_status_Manager::get_StuNum()
{
	ifstream ifs;
	ifs.open(FILENAME1, ios::in);//打开文件,读出数据
	int id;
	string name;
	string sex;
	int age;
	int phone;
	string maj;
	int num = 0;
	while (ifs >> id && ifs >> name && ifs >> sex && ifs >> age && ifs >> phone && ifs >> maj)
	{
		num++;
	}
	return num;
}
//统计录入人数
int Student_status_Manager::fileStuNum(string filename)
{
	ifstream ifs;
	ifs.open(filename, ios::in);//打开文件,读出数据
	int id;
	string name;
	string sex;
	int age;
	int phone;
	string maj;
	int num = 0;
	while (ifs >> id && ifs >> name && ifs >> sex && ifs >> age && ifs >> phone && ifs >> maj)
	{
		num++;
	}
	return num;
}
//初始化学生数据
void Student_status_Manager::init_Stu()
{
	ifstream ifs;
	//打开文件,读出数据
	ifs.open(FILENAME1, ios::in);
	int id;
	string name;
	string sex;
	int age;
	int phone;
	string maj;
	int index = 0;
	while (ifs >> id && ifs >> name && ifs >> sex && ifs >> age && ifs >> phone && ifs >> maj)
	{
		Student* student = NULL;
		student = new Student(id, name, sex, age, phone, maj);
		this->m_StuArray[index] = student;
		index++;
	}
	ifs.close();
}
//录入学生数据
void Student_status_Manager::Input_Stu()
{
	ifstream ifs;
	cout << "请输入你要录入学生信息的txt文件名" << endl;
	//乱码问题解决
	//ANSI编码
	string filename;
	cin >> filename;
	//计算新空间的大小
	int newsize = this->fileStuNum(filename) + this->m_StuNum;
	//开辟新空间
	Student** newspace = new Student * [newsize * sizeof(Student)];
	//将原空间下的数据拷贝到新空间
	if (this->m_StuArray != NULL)
	{
		for (int i = 0; i < this->m_StuNum; i++)
		{
			newspace[i] = this->m_StuArray[i];
		}
	}
	ifs.open(filename, ios::in);//打开文件,读出数据
	int id;
	string name;
	string sex;
	int age;
	int phone;
	string maj;
	int index = 0;
	while (ifs >> id && ifs >> name && ifs >> sex && ifs >> age && ifs >> phone && ifs >> maj)
	{
		Student* student = NULL;
		student = new Student(id, name, sex, age, phone, maj);
		newspace[this->m_StuNum + index] = student;
		index++;
	}
	ifs.close();
	//释放原有空间
	delete[]this->m_StuArray;
	//更改新空间指向
	this->m_StuArray = newspace;
	//更新新的学生人数
	this->m_StuNum = newsize;
	//更新学生不为空的标志
	this->m_FileIsExist = false;
	//提示添加成功
	cout << "成功输入 " << this->fileStuNum(filename) << " 名学生学籍信息" << endl;
	//添加成功后保存到文件中
	this->save();
	system("pause");
	system("cls");
}
//显示学生信息
void Student_status_Manager::Show_Stu()
{
	if (this->m_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
	}
	else
	{
		for (int i = 0; i < m_StuNum; i++)
		{
			this->m_StuArray[i]->show_status_Info();
			cout << endl;
		}
	}
	system("pause");
	system("cls");
}
//删除学生
void Student_status_Manager::Del_Stu()
{
	if (this->m_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
	}
	else
	{
		//按照学生姓名删除
		cout << "请输入要删除的学生的姓名" << endl;
		string name;
		cin >> name;
		//记录重名人数
		int num = 0;
		for (int i = 0; i < m_StuNum; i++)
		{
			//计算重名人数
			if (this->m_StuArray[i]->m_name == name)
			{
				num++;
			}
		}
		if (num == 1)
		{
			int index = this->isExist(name);
			for (int i = index; i < this->m_StuNum - 1; i++)
			{
				//后方数据前移
				this->m_StuArray[i] = this->m_StuArray[i + 1];
			}
			//更新数组记录人员数
			this->m_StuNum--;
			//数据同步到文件
			this->save();
			if (this->m_StuNum == 0)
			{
				this->m_FileIsExist = true;
			}
			cout << "删除成功" << endl;
		}
		else if (num > 1)
		{
			cout << "共找到 " << num << " 名重名学生"<<endl;
			for (int i = 0; i < m_StuNum; i++)
			{
				if (this->m_StuArray[i]->m_name == name)
				{
					cout << "学生学号为 " << this->m_StuArray[i]->m_id << " 号学生信息如下" << endl;
					this->m_StuArray[i]->show_status_Info();
					cout << endl;
				}
			}
			while (true)
			{
				cout << "请输入删除学生的学号:";
				int del_id;
				cin >> del_id;
				int index = this->isExist1(del_id);
				for (int i = index; i < this->m_StuNum - 1; i++)
				{
					//后方数据前移
					this->m_StuArray[i] = this->m_StuArray[i + 1];
				}
				//更新数组记录人员数
				this->m_StuNum--;
				//数据同步到文件
				this->save();
				if (this->m_StuNum == 0)
				{
					this->m_FileIsExist = true;
				}
				cout << "删除成功,若结束请输入0,继续删除请输入1" << endl;
				int exit = 1;
				cin >> exit;
				if (exit == 0)
				{
					break;
				}
			}
		}
		else
		{
			cout << "未找到该学生,删除失败" << endl;
		}
	}
	system("pause");
	system("cls");
}
//依据学号判断学生是否存在   //如果存在返回学生的位置,如果不存在返回-1
int Student_status_Manager::isExist1(int id)
{
	int index = -1;
	for (int i = 0; i < m_StuNum; i++)
	{
		if (this->m_StuArray[i]->m_id == id)
		{
			index = i;
			break;
		}
	}
	return index;
}
//依据电话判断学生是否存在   //如果存在返回学生的位置,如果不存在返回-1
int Student_status_Manager::isExist2(int phone)
{
	int index = -1;
	for (int i = 0; i < m_StuNum; i++)
	{
		if (this->m_StuArray[i]->m_phone == phone)
		{
			index = i;
			break;
		}
	}
	return index;
}
//依据姓名判断学生是否存在   //如果存在返回学生的位置,如果不存在返回-1
int Student_status_Manager::isExist(string name)
{
	int index = -1;
	for (int i = 0; i < m_StuNum; i++)
	{
		if (this->m_StuArray[i]->m_name == name)
		{
			index = i;
			break;
		}
	}
	return index;
}
//修改学生
void Student_status_Manager::Mod_Stu()
{
	if (this->m_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
	}
	else
	{
		//按照学生姓名查找
		cout << "请输入要修改的学生的姓名" << endl;
		string name;
		cin >> name;
		//记录重名人数
		int num = 0;
		for (int i = 0; i < m_StuNum; i++)
		{
			//计算重名人数
			if (this->m_StuArray[i]->m_name == name)
			{
				num++;
			}
		}
		if (num == 1)
		{
			int ret = this->isExist(name);
			delete this->m_StuArray[ret];
			int newId;
			string Name;
			string sex;
			int age;
			int phone;
			string maj;
			cout << "查到姓名为 " << name << " 的学生" << endl;
			cout << "请输入新的学生号:" << endl;
			while (true)//判断是否有重复学号
			{
				cin >> newId;
				if (this->isExist1(newId) != -1)
				{
					cout << "学号重复,请重新输入" << endl;
				}
				else
				{
					break;
				}
			}
			cout << "请输入学生姓名:" << endl;
			cin >> Name;
			cout << "请输入学生性别:" << endl;
			cin >> sex;
			cout << "请输入学生年龄:" << endl;
			cin >> age;
			cout << "请输入学生电话:" << endl;
			cin >> phone;
			cout << "请输入学生专业:" << endl;
			cin >> maj;
			Student* student = NULL;
			student = new Student(newId, name, sex, age, phone, maj);
			//更新数据到数组中
			this->m_StuArray[ret] = student;
			cout << "修改成功" << endl;
			//保存到文件中
			this->save();
		}
		else if (num > 1)
		{
			cout << "共找到 " << num << " 名重名学生" << endl;
			for (int i = 0; i < m_StuNum; i++)
			{
				if (this->m_StuArray[i]->m_name == name)
				{
					cout << "学生学号为 " << this->m_StuArray[i]->m_id << " 号学生信息如下" << endl;
					this->m_StuArray[i]->show_status_Info();
					cout << endl;
				}
			}
			while (num!=0)
			{
				cout << "请输入修改的学生的学号:";
				int del_id;
				cin >> del_id;
				int index = this->isExist1(del_id);
				delete this->m_StuArray[index];
				int newId;
				string Name;
				string sex;
				int age;
				int phone;
				string maj;
				cout << "请输入新的学生号:" << endl;
				while (true)//判断是否有重复学号
				{
					cin >> newId;
					if (this->isExist1(newId) != -1)
					{
						cout << "学号重复,请重新输入" << endl;
					}
					else
					{
						break;
					}
				}
				cout << "请输入学生姓名:" << endl;
				cin >> Name;
				cout << "请输入学生性别:" << endl;
				cin >> sex;
				cout << "请输入学生年龄:" << endl;
				cin >> age;
				cout << "请输入学生电话:" << endl;
				cin >> phone;
				cout << "请输入学生专业:" << endl;
				cin >> maj;
				Student* student = NULL;
				student = new Student(newId, name, sex, age, phone, maj);
				//更新数据到数组中
				this->m_StuArray[index] = student;
				cout << "修改成功,若结束修改请输入0,继续修改请输入1" << endl;
				//保存到文件中
				this->save();
				int exit = 1;
				cin >> exit;
				if (exit == 0)
				{
					break;
				}
				num--;
			}
		}
		else
		{
			cout << "未找到该学生,修改失败" << endl;
		}
	}
	system("pause");
	system("cls");
}
//查找学生
void Student_status_Manager::Find_Stu()
{
	if (this->m_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
	}
	else
	{
		cout << "请选择查找的方式" << endl;
		cout << "1.按学生学号查找" << endl;
		cout << "2.按学生电话查找" << endl;
		cout << "3.按学生姓名查找" << endl;
		int select = 0;
		cin >> select;
		//判断是否为合法输入
		while ((!cin) || (select != 1 && select != 2 && select != 3))
		{
			cin.clear();
			cin.ignore();
			cout << "输入有误,请重新输入" << endl;
			cin >> select;
		}
		if (select == 1)
		{
			//按学号查
			int id;
			cout << "请输入查找的学生学号" << endl;
			cin >> id;
			int ret = this->isExist1(id);
			if (ret != -1)
			{
				cout << "查找成功,学生学籍信息如下:" << endl;
				this->m_StuArray[ret]->show_status_Info();
				cout << endl;
			}
			else
			{
				cout << "未找到该学生学籍信息" << endl;
			}
		}
		else if (select == 2)
		{
			//按电话查
			int phone;
			cout << "请输入查找的学生电话" << endl;
			cin >> phone;
			int ret = this->isExist2(phone);
			if (ret != -1)
			{
				cout << "查找成功,学生学籍信息如下:" << endl;
				this->m_StuArray[ret]->show_status_Info();
				cout << endl;
			}
			else
			{
				cout << "未找到该学生学籍信息" << endl;
			}
		}
		else if (select == 3)
		{
			//按姓名查
			string name;
			cout << "请输入查找的学生姓名" << endl;
			cin >> name;
			//判断是否查到
			bool flag = false;
			for (int i = 0; i < m_StuNum; i++)
			{
				//将所有同名学生输出
				if (this->m_StuArray[i]->m_name == name)
				{
					cout << "查找成功,学生学号为 " << this->m_StuArray[i]->m_id << " 号学生信息如下:" << endl;
					this->m_StuArray[i]->show_status_Info();
					cout << endl;
					flag = true;
				}
			}
			if (flag == false)
			{
				cout << "未找到该学生学籍信息" << endl;
			}
		}
	}
	system("pause");
	system("cls");
}

3.3 成绩信息管理功能

Student_grades_Manager.h

#pragma once
#include<iostream>
#include"Student.h"
#include<fstream>
#include<string>
#define FILENAME2 "Stu_grades_file.txt"
using namespace std;
class Student_grades_Manager
{
public:
	//构造函数
	Student_grades_Manager();
	//析构函数
	~Student_grades_Manager();
	//展示菜单
	void show_menu();
	//保存到文件
	void save();
	//统计学生人数
	int get_StuNum();
	//初始化学生信息
	void init_Stu();
	//统计录入人数
	int fileStuNum(string filename);
	//录入学生数据
	void Input_Stu();
	//计算课程成绩
	void Course_grades();
	//计算个人成绩
	void Ind_grades();
	//计算学生总分
	float Per_total_scores(int i);
	//记录学生成绩排名
	int Stu_Grade_ranking(int id);
	//判断学生是否存在   函数重载
	int isExist1(int id);//如果存在返回学生的位置,如果不存在返回-1
	int isExist2(string name);//如果存在返回学生的位置,如果不存在返回-1
	//依据总分排名次表
	//依据学号排成绩表
	void Sort_Stu();
	//查询学生成绩
	void Find_Stu();
	//查询语文最高分的学籍信息
	void Find_Lan_Stu();
	//查询总成绩最高的3名学生的学籍信息和总分
	void Find_total_scores_TOP3();
	//根据同分情况计算同排名人数
	int Same_score_Stu(float score);
	//记录学生人数
	int n_StuNum;
	//学生数组指针
	Student** n_StuArray;
	//判断文件是否存在标志
	bool n_FileIsExist;
	//记录学生成绩排名
	float Stu_G_r[1000];
};

Student_grades_Manager.cpp

#include"Student_grades_Manager.h"
#include"Student_status_Manager.h"
#include"Student.h"
#include<iostream>
//构造函数
Student_grades_Manager::Student_grades_Manager()
{
	ifstream ifs;
	ifs.open(FILENAME2, ios::in);
	//1.文件不存在
	if (!ifs.is_open())
	{
		//初始化属性
		this->n_StuNum = 0;
		this->n_StuArray = NULL;
		this->n_FileIsExist = true;
		ifs.close();
	}
	//2.文件存在,数据为空
	char ch;
	ifs >> ch;
	if (ifs.eof())
	{
		//初始化属性
		this->n_StuNum = 0;
		this->n_StuArray = NULL;
		this->n_FileIsExist = true;
		ifs.close();
	}
	//3.文件存在,数据存在
	else
	{
		ifs.close();
		int num = this->get_StuNum();
		this->n_StuNum = num;
		//开辟空间
		this->n_StuArray = new Student * [this->n_StuNum];
		//将文件中的数据存到数组中
		this->init_Stu();
	}
}
//析构函数
Student_grades_Manager::~Student_grades_Manager()
{
	if (this->n_StuArray != NULL)
	{
		for (int i = 0; i < n_StuNum; i++)
		{
			if (this->n_StuArray[i] != NULL)
			{
				delete this->n_StuArray[i];
			}
		}
		delete[]this->n_StuArray;
		this->n_StuArray = NULL;
	}
}
//展示菜单
void Student_grades_Manager::show_menu()
{
	cout << "********************************************" << endl;
	cout << "********* 欢迎使用成绩信息管理功能 *********" << endl;
	cout << "************** 0.返回上一界面 **************" << endl;
	cout << "************** 1.录入学生成绩 **************" << endl;
	cout << "************** 2.计算课程成绩 **************" << endl;
	cout << "************** 3.计算学生成绩 **************" << endl;
	cout << "************** 4.总分学号排表 **************" << endl;
	cout << "************** 5.查询学生成绩 **************" << endl;
	cout << "********************************************" << endl;
	cout << endl;
}
//保存到文件
void Student_grades_Manager::save()
{
	ofstream ofs;
	//打开文件,写入数据
	ofs.open(FILENAME2, ios::out);
	for (int i = 0; i < this->n_StuNum; i++)
	{
		//数据写入文件
		ofs << this->n_StuArray[i]->m_id
			<< " " << this->n_StuArray[i]->m_name
			<< " " << this->n_StuArray[i]->m_maj
			<< " " << this->n_StuArray[i]->Lan_scores
			<< " " << this->n_StuArray[i]->Math_scores
			<< " " << this->n_StuArray[i]->Eng_scores << endl;
	}
	ofs.close();
}
//统计学生人数
int Student_grades_Manager::get_StuNum()
{
	ifstream ifs;
	ifs.open(FILENAME2, ios::in);//打开文件,读出数据
	int id;
	string name;
	string maj;
	float Languagescores;
	float Mathscores;
	float Englishscores;
	int num = 0;
	while (ifs >> id && ifs >> name && ifs >> maj && ifs >> Languagescores && ifs >> Mathscores && ifs >> Englishscores)
	{
		num++;
	}
	return num;
}
//初始化学生信息
void Student_grades_Manager::init_Stu()
{
	ifstream ifs;
	//打开文件,读出数据
	ifs.open(FILENAME2, ios::in);
	int id;
	string name;
	string maj;
	float Languagescores;
	float Mathscores;
	float Englishscores;
	int index = 0;
	while (ifs >> id && ifs >> name && ifs >> maj && ifs >> Languagescores && ifs >> Mathscores && ifs >> Englishscores)
	{
		Student* student = NULL;
		student = new Student(id, name, maj, Languagescores, Mathscores, Englishscores);
		this->n_StuArray[index] = student;
		index++;
	}
	ifs.close();
}
//统计录入人数
int Student_grades_Manager::fileStuNum(string filename)
{
	ifstream ifs;
	ifs.open(filename, ios::in);//打开文件,读出数据
	int id;
	string name;
	string maj;
	float Languagescores;
	float Mathscores;
	float Englishscores;
	int num = 0;
	while (ifs >> id && ifs >> name && ifs >> maj && ifs >> Languagescores && ifs >> Mathscores && ifs >> Englishscores)
	{
		num++;
	}
	return num;
}
//录入学生数据
void Student_grades_Manager::Input_Stu()
{
	ifstream ifs;
	cout << "请输入你要录入学生信息的txt文件名" << endl;
	//乱码问题解决	//ANSI编码
	string filename;
	cin >> filename;
	//计算新空间的大小
	int newsize = this->fileStuNum(filename) + this->n_StuNum;
	//开辟新空间
	Student** newspace = new Student * [newsize * sizeof(Student)];
	//将原空间下的数据拷贝到新空间
	if (this->n_StuArray != NULL)
	{
		for (int i = 0; i < this->n_StuNum; i++)
		{
			newspace[i] = this->n_StuArray[i];
		}
	}
	//打开文件,读出数据
	ifs.open(filename, ios::in);
	int id;
	string name;
	string maj;
	float Languagescores;
	float Mathscores;
	float Englishscores;
	int index = 0;
	while (ifs >> id && ifs >> name && ifs >> maj && ifs >> Languagescores && ifs >> Mathscores && ifs >> Englishscores)
	{
		Student* student = NULL;
		student = new Student(id, name, maj, Languagescores, Mathscores, Englishscores);
		newspace[this->n_StuNum + index] = student;
		index++;
	}
	ifs.close();
	//释放原有空间
	delete[]this->n_StuArray;
	//更改新空间指向
	this->n_StuArray = newspace;
	//更新新的学生人数
	this->n_StuNum = newsize;
	//更新学生不为空的标志
	this->n_FileIsExist = false;
	//提示添加成功
	cout << "成功录入 " << this->fileStuNum(filename) << " 名学生成绩信息" << endl;
	//添加成功后保存到文件中
	this->save();
	system("pause");
	system("cls");
}
//计算课程成绩
void Student_grades_Manager::Course_grades()
{
	float Lan_Sum = 0;
	float Math_Sum = 0;
	float Eng_Sum = 0;
	for (int i = 0; i < n_StuNum; i++)
	{
		Lan_Sum += n_StuArray[i]->Lan_scores;
		Math_Sum += n_StuArray[i]->Math_scores;
		Eng_Sum += n_StuArray[i]->Eng_scores;
	}
	cout << "语文总分:" << Lan_Sum << endl;
	cout << "语文均分:" << (Lan_Sum / n_StuNum) << endl;
	cout << endl;
	cout << "数学总分:" << Math_Sum << endl;
	cout << "数学均分:" << (Math_Sum / n_StuNum) << endl;
	cout << endl;
	cout << "英语总分:" << Eng_Sum << endl;
	cout << "英语均分:" << (Eng_Sum / n_StuNum) << endl;
	cout << endl;
	system("pause");
	system("cls");
}
//计算个人成绩
void Student_grades_Manager::Ind_grades()
{
	for (int i = 0; i < n_StuNum; i++)
	{
		cout << "学号为 " << n_StuArray[i]->m_id << " 的" << n_StuArray[i]->m_name << "同学成绩如下" << endl;
		cout << "总分:" << this->Per_total_scores(i)
			<< "\t均分:" << (this->Per_total_scores(i) / 3) << endl;
	}
	system("pause");
	system("cls");
}
//计算学生总分
float Student_grades_Manager::Per_total_scores(int i)
{
	float person_total;
	person_total = n_StuArray[i]->Lan_scores + n_StuArray[i]->Math_scores + n_StuArray[i]->Eng_scores;
	return person_total;
}
//判断学生是否存在   //函数重载
//如果存在返回学生的位置,如果不存在返回-1
//根据学号判断
int Student_grades_Manager::isExist1(int id)
{
	int index = -1;
	for (int i = 0; i < n_StuNum; i++)
	{
		if (this->n_StuArray[i]->m_id == id)
		{
			index = i;
			break;
		}
	}
	return index;
}
//根据姓名判断
int Student_grades_Manager::isExist2(string name)
{
	int index = -1;
	for (int i = 0; i < n_StuNum; i++)
	{
		if (this->n_StuArray[i]->m_name == name)
		{
			index = i;
			break;
		}
	}
	return index;
}
//记录学生成绩排名
int Student_grades_Manager::Stu_Grade_ranking(int a)
{
	//将学生的总分记录在数组
	for (int i = 0; i < n_StuNum; i++)
	{
		this->Stu_G_r[i] = this->Per_total_scores(i);
	}
	//冒泡排序
	for (int i = 0; i < n_StuNum - 1; i++)
	{
		for (int j = 0; j < n_StuNum - i - 1; j++)
		{
			if (this->Stu_G_r[j] < this->Stu_G_r[j + 1])
			{
				float temp = this->Stu_G_r[j];
				this->Stu_G_r[j] = this->Stu_G_r[j + 1];
				this->Stu_G_r[j + 1] = temp;
			}
		}
	}
	//返回排名
	for (int i = 0; i < n_StuNum; i++)
	{
		if (this->Stu_G_r[i] == this->Per_total_scores(a))
		{
			return i + 1;
		}
	}
	return 0;
}
//根据同分情况计算同排名人数
int Student_grades_Manager::Same_score_Stu(float score)
{
	int num = 0;
	for (int i = 0; i < n_StuNum; i++)
	{
		if (this->Per_total_scores(i) == score)
		{
			num++;
		}
	}
	return num - 1;
}
//依据总分排名次表	//依据学号排成绩表
void Student_grades_Manager::Sort_Stu()
{
	if (this->n_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
		system("pause");
		system("cls");
	}
	else
	{
		cout << "请选择排表方式:" << endl;
		cout << "1.按学生的总分降序排表。" << endl;
		cout << "2.按学生的学号升序排表。" << endl;
		int select = 0;
		cin >> select;
		while ((!cin) || (select != 1 && select != 2))
		{
			cin.clear();
			cin.ignore();
			cout << "输入有误,请重新输入" << endl;
			cin >> select;
		}
		if (select == 1)
		{
			//1.按学生的总分降序排名次表。
			//冒泡排序
			for (int i = 0; i < n_StuNum - 1; i++)
			{
				for (int j = 0; j < n_StuNum - i - 1; j++)
				{
					if (this->Per_total_scores(j) < this->Per_total_scores(j + 1))
					{
						Student* tStu = this->n_StuArray[j];
						this->n_StuArray[j] = this->n_StuArray[j + 1];
						this->n_StuArray[j + 1] = tStu;
					}
				}
			}
			//输出排序结果 不做保存
			for (int i = 0; i < n_StuNum; i++)
			{
				//同分处理
				if (this->Same_score_Stu(this->Per_total_scores(i)) != 0)
				{
					int k = i;
					for (k = i; k <= i + this->Same_score_Stu(this->Per_total_scores(i)); k++)
					{
						this->n_StuArray[k]->show_grades_Info();
						cout << "\t总分:" << this->Per_total_scores(k) << "\t第 " << i + 1 << " 名" << endl;
					}
					i += this->Same_score_Stu(this->Per_total_scores(i));
				}
				else if (this->Same_score_Stu(this->Per_total_scores(i)) == 0)
				{
					this->n_StuArray[i]->show_grades_Info();
					cout << "\t总分:" << this->Per_total_scores(i) << "\t第 " << i + 1 << " 名" << endl;
				}
			}
		}
		if (select == 2)
		{
			//2.按学生的学号升序排成绩表。
			//选择排序
			for (int i = 0; i < n_StuNum; i++)
			{
				//定义一个最小值下标
				int Min = i;
				for (int j = i + 1; j < n_StuNum; j++)
				{
					if (this->n_StuArray[Min]->m_id > this->n_StuArray[j]->m_id)
					{
						Min = j;
					}
				}
				if (i != Min)
				{
					Student* tStu = this->n_StuArray[i];
					this->n_StuArray[i] = this->n_StuArray[Min];
					this->n_StuArray[Min] = tStu;
				}
			}
			//输出排序结果 不做保存
			for (int i = 0; i < n_StuNum; i++)
			{
				this->n_StuArray[i]->show_grades_Info();
				cout << "\t总分:" << this->Per_total_scores(i) << "\t第 " << this->Stu_Grade_ranking(this->isExist1(this->n_StuArray[i]->m_id)) << " 名" << endl;
			}
		}
		system("pause");
		system("cls");
	}
}
//查询学生成绩
void Student_grades_Manager::Find_Stu()
{
	if (this->n_FileIsExist)
	{
		cout << "文件不存在或记录为空!" << endl;
	}
	else
	{
		cout << "请选择查询的方式:" << endl;
		cout << "1.按学号查询学生排名及其考试成绩" << endl;
		cout << "2.按姓名查询学生排名及其考试成绩" << endl;
		cout << "3.查询语文最高分的学生学籍信息" << endl;
		cout << "4.查询总成绩排名前三的学生的学籍信息和总分" << endl;
		int select = 0;
		cin >> select;
		//判断是否为合法输入
		while ((!cin) || (select != 1 && select != 2 && select != 3 && select != 4))
		{
			cin.clear();
			cin.ignore();
			cout << "输入有误,请重新输入" << endl;
			cin >> select;
		}
		if (select == 1)
		{
			//按学号查询学生排名及其考试成绩
			int id;
			cout << "请输入查找的学生学号" << endl;
			cin >> id;
			int ret = this->isExist1(id);
			if (ret != -1)
			{
				cout << "查找成功,学生信息如下:" << endl;
				this->n_StuArray[ret]->show_grades_Info();
				cout << "\t总分:" << this->Per_total_scores(ret)
					<< "\t第 " << this->Stu_Grade_ranking(ret) << " 名"
					<< endl;
			}
			else
			{
				cout << "未查到该学生的成绩信息" << endl;
			}
		}
		else if (select == 2)
		{
			//按姓名查询学生排名及其考试成绩
			string name;
			cout << "请输入查找的学生姓名" << endl;
			cin >> name;
			//判断是否查到
			bool flag = false;
			for (int i = 0; i < n_StuNum; i++)
			{
				//将所有同名学生输出
				if (this->n_StuArray[i]->m_name == name)
				{
					cout << "查找成功,学生学号为 " << this->n_StuArray[i]->m_id << " 号学生信息如下:" << endl;
					this->n_StuArray[i]->show_grades_Info();
					cout << "\t总分:" << this->Per_total_scores(i)
						<< "\t第 " << this->Stu_Grade_ranking(this->isExist1(this->n_StuArray[i]->m_id)) << " 名"
						<< endl;
					flag = true;
				}
			}
			if (flag == false)
			{
				cout << "未查到该学生的成绩信息" << endl;
			}
		}
		else if (select == 3)
		{
			//查询语文最高分的学生学籍信息
			this->Find_Lan_Stu();
		}
		else if (select == 4)
		{
			//查询总成绩最高的3名学生的学籍信息和总分
			this->Find_total_scores_TOP3();
		}
	}
	system("pause");
	system("cls");
}
//查询语文最高分的学籍信息
void Student_grades_Manager::Find_Lan_Stu()
{
	//定义一个最大值下标
	int Max = 0;
	for (int i = 0; i < this->n_StuNum; i++)
	{
		if (this->n_StuArray[Max]->Lan_scores < this->n_StuArray[i]->Lan_scores)
		{
			Max = i;
		}
	}
	//创建临时对象
	Student_status_Manager temp;
	//记录重分人数
	int num = 0;
	for (int i = 0; i < this->n_StuNum; i++)
	{
		//计算重分人数
		if (this->n_StuArray[Max]->Lan_scores == this->n_StuArray[i]->Lan_scores)
		{
			num++;
		}
	}
	if (num == 1)
	{
		//找到对应姓名的学生数据
		int ret = temp.isExist1(Student_grades_Manager::n_StuArray[Max]->m_id);
		//输出该学生学籍信息
		if (ret != -1)
		{
			cout << "语文最高分学生学籍信息如下:" << endl;
			temp.m_StuArray[ret]->show_status_Info();
			cout << endl;
		}
		else
		{
			cout << "未在学籍系统找到" << this->n_StuArray[Max]->m_name << "的学生数据" << endl;
		}
	}
	else if (num > 1)
	{
		cout << "语文最高分学生共有 " << num << " 名,语文分数均为 " << this->n_StuArray[Max]->Lan_scores << " 分,其学籍信息如下:" << endl;
		for (int i = 0; i < this->n_StuNum; i++)
		{
			//将所有同分学生输出
			if (this->n_StuArray[Max]->Lan_scores == this->n_StuArray[i]->Lan_scores)
			{
				cout << "学生 " << temp.m_StuArray[i]->m_name << " 信息如下:" << endl;
				temp.m_StuArray[i]->show_status_Info();
				cout << endl;
			}
		}
	}
}
//查询总排名前三的学生的学籍信息和总分
void Student_grades_Manager::Find_total_scores_TOP3()
{
	//同分处理
	for (int i = 0; i < n_StuNum - 1; i++)
	{
		for (int j = 0; j < n_StuNum - i - 1; j++)
		{
			if (this->Per_total_scores(j) < this->Per_total_scores(j + 1))
			{
				Student* tStu = this->n_StuArray[j];
				this->n_StuArray[j] = this->n_StuArray[j + 1];
				this->n_StuArray[j + 1] = tStu;
			}
		}
	}
	cout << "总成绩排名前三的学生学籍信息如下:" << endl;
	int j = 0;
	while (this->Stu_Grade_ranking(j) < 4)
	{
		int num = 0;
		for (int i = j+1; i < this->n_StuNum; i++)
		{
			//计算总分排名前三的学生重分人数
			if (this->Per_total_scores(j) == this->Per_total_scores(i))
			{
				num++;
			}
		}
		if (num == 0)
		{
			//创建临时对象
			Student_status_Manager temp;
			//找到对应学号的学生数据
			int ret = temp.isExist1(Student_grades_Manager::n_StuArray[j]->m_id);
			if (ret != -1)
			{
				temp.m_StuArray[ret]->show_status_Info();
				cout << "\t总分:" << this->Per_total_scores(j) << endl;
				j++;
			}
			else
			{
				cout << "未在学籍系统找到" << this->n_StuArray[j]->m_name << "的学生数据" << endl;
			}
		}
		else if (num > 0)
		{
			//创建临时对象
			Student_status_Manager temp;
			for (int i = j; i < this->n_StuNum; i++)
			{
				//将所有同排名学生输出
				if (this->Per_total_scores(j) == this->Per_total_scores(i))
				{
					int ret = temp.isExist1(Student_grades_Manager::n_StuArray[i]->m_id);
					if (ret != -1)
					{
						temp.m_StuArray[ret]->show_status_Info();
						cout << "\t总分:" << this->Per_total_scores(j) << endl;
					}
					else
					{
						cout << "未在学籍系统找到"<<this->n_StuArray[j]->m_name << "的学生数据" << endl;
					}
				}
			}
			j =j+num+1;
		}
	}
}

3.4 学生类

Student.h

#pragma once
#include<iostream>
#include<string>
using namespace std;
class Student
{
public:
	//构造函数
	Student(int id, string name, string sex, int age, int phone, string maj);
	Student(int id, string name, string maj, float Languagescores, float Mathscores, float Englishscores);
	//显示个人学籍信息
	void show_status_Info();
	//显示个人成绩信息
	void show_grades_Info();
	//学生学号
	int m_id;
	//学生姓名
	string m_name;
	//学生性别
	string m_sex;
	//学生年龄
	int m_age;
	//学生电话
	int m_phone;
	//学生专业
	string m_maj;
	//学生语文成绩
	float Lan_scores;
	//学生数学成绩
	float Math_scores;
	//学生英语成绩
	float Eng_scores;
};

Student.cpp

#include"Student.h"
#include<iomanip>
//构造函数
Student::Student(int id, string name, string sex, int age, int phone, string maj)
{
	this->m_id = id;
	this->m_name = name;
	this->m_sex = sex;
	this->m_age = age;
	this->m_phone = phone;
	this->m_maj = maj;
}
Student::Student(int id, string name, string maj, float Languagescores, float Mathscores, float Englishscores)
{
	this->m_id = id;
	this->m_name = name;
	this->m_maj = maj;
	this->Lan_scores = Languagescores;
	this->Math_scores = Mathscores;
	this->Eng_scores = Englishscores;
}
//显示个人学籍信息
void Student::show_status_Info()
{
	cout << "学生学号:" << this->m_id
		<< "\t学生姓名:" << this->m_name
		<< "\t学生性别:" << this->m_sex
		<< "\t学生年龄:" << this->m_age
		<< "\t学生电话:" << this->m_phone
		<< "\t学生专业:" << this->m_maj;
}
//显示个人成绩信息
void Student::show_grades_Info()
{
	cout << "学生学号:" <<  this->m_id
		<< "\t学生姓名:" <<  this->m_name
		<< "\t学生专业:" <<  this->m_maj
		<< "\t语文成绩:" <<  this->Lan_scores
		<< "\t数学成绩:" <<  this->Math_scores
		<< "\t英语成绩:" <<  this->Eng_scores;
}

4    测试与总结

4.1 测试和调试

在调试和测试的环节上是比较费时间的,经常因为一些问题排查半天,比如漏掉字符,调用出错,死循环,头文件未包含,编码问题,指针访问出错,我这边说一下我在程序制作中遇到的几个问题。
1.UTF-8编码的txt文件在visual studio2022中读取时会出现中文乱码问题,一开始都不知道为什么会乱码,后面通过查询了解到是记事本的编码跟编译器软件编码不一致导致的。

解决方案是:将要导入的数据文件和保存文件的编码设置为ANSI编码。

2.调用成员函数时未包含头文件导致调用出错,调用不同类的同名函数时未注明函数的作用域导致调用出错。

解决方案:在需要调用其他类的成员函数的源文件中包含相应的头文件,并添加作用域限定。
3.在防止用户输入非法字符的while循环中未添加跳出循环的条件导致死循环。

解决方案:程序设计时先建立框架再进行内容的填充,确保跳出循环的条件存在。

4.在成绩信息管理功能中需要用到学籍信息管理功能内的数据,两个功能存储的数据存放在两个文件中,当使用成绩系统时候若未先进行学籍注册,学籍系统中没有该学生的学籍信息,出现访问异常。

解决方案:利用学籍信息管理类成员函数判断是否存在学籍信息确认存在再进行访问数据。

4.2 收获及心得体会

通过课程设计对系统的分析,我对程序设计有了一些的了解,也让我意识到只有通过实践,才能真正理解书上所叙述的内容,操作是学习编程必不可少的一门环节。


新手发文,水平有限,不当之处,还望指正。

  • 15
    点赞
  • 95
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

启东活络人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值