C++课程设计学生信息管理源码, VC环境测试通过。
.h文件
#include <string>
using namespace std;
class info //信息类
{
public:
string NAME;
string GRADE;
string SEX;
string YARD;
string CPP;
string ENGLISH;
string MATH;
};
class node:virtual public info //结点类(虚基类)
{
public:
node* left;
node* right;
node(); //构造函数
void add(node* n); //添加信息
node* del1(); //删除信息
void show(); //显示信息
};
//删除实现方式
node* delete1(node& head, string name);
//添加信息方式将数据赋值给数据成员
void init(node &head,string name,string grade,string sex,string yard,string cpp,string english,string math);
//删除函数
void del(node* n);
//信息录入
void enter(node& head);
//实现显示
void display(node& head);
//实现查找
void search(node& head, string name);
//信息保存
void save(node &head);
//菜单1 管理员菜单
void menu1(node& head);
//菜单2 学生菜单
void menu2(node& head);
.cpp文件
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include ""
#include ""
using namespace std;
node::node() //构造函数初始化
{
left=0,right=0;
}
void node::add(node* n) //实现信息添加
{
n->right=right;
n->left=this;
if(right!=NULL)right->left=n;
right=n;
}
node* node::del1() //实现删除
{
if(left!=0)left->right=right;
if(right!=0)right->left=left;
return 0;
}
void node::show() //信息显示方式
{
cout<<"姓名:" <<setw(8)<<NAME<<endl;
cout<<"班级:" <<setw(8)<<GRADE<<endl;
cout<<
C 程序设计学生信息管理源码 来自淘豆网www.taodocs.com转载请标明出处.