C++课程设计学生成绩管理系统 第7页
//stu.h
class STUDENT
{
private:
char term[10];
char num[10];
char name[10];
char sex[10];
char cname[20];
float sum;
float average;
STUDENT *next;
float english;
float math;
float c;
float wl;
public:
STUDENT()
{ next=0;}
~STUDENT()
{}
void Input();
void Input(ifstream &f);
static void OutputT();
static void OutputTtwo();
void OutputT(ofstream &f);
void Output();
void Outputtwo();
void OutputTtwo(ofstream &f);
void Output(ofstream &f);
void Outputtwo(ofstream &f);
friend class CLASS;};
//class.h
class CLASS
{
private:
STUDENT *SL;
void Clear();
int Find(char*nterm,char*NCLASS,char*nname,STUDENT **p1,STUDENT **p2);
int Find2(char *nterm,char*NCLASS,char*id,STUDENT **p1,STUDENT **p2);
void ValueS2ToS1(STUDENT &s1,STUDENT &s2);
int Findtwo(char*nterm,char*NCLASS,STUDENT **p1,STUDENT **p2);
int Findthree(char*NCLASS,STUDENT **p1,STUDENT **p2);
public:
CLASS()
{SL=new STUDENT();}
~CLASS()
{ STUDENT *p=SL;
while(p)
{
SL=p->next;
delete p;
p=SL;
}
}
void Add();
void Delete();
void Modify();
void Query();
void Print();
void Printtwo();
void Fail();
void AverSort();
void Print1();
void Save();
void Load();
friend STUDENT;
};
//stu.cpp
#include <fstream.h>
#include <iomanip.h>
#include <string.h>
#include <ctype.h>
#include"stu.h"
void STUDENT::Input()
{
sum=0;
average=0;
english=0;
math=0;
cout<<"班级(1~4):"; cin>>cname;
cout<<"学号(应该要大于0):"; cin>>num;
cout<<"姓名:"; cin>>name;
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>