#include<string>
#include<ctime>
#include<iostream>
#include<>
#include<fstream>
#include<>
using namespace std;
int s=0;
int u=0;
class teacher;
class student
{
public:
void resetsno(int);
void inputst(char * ,char *,int,int,char *,long);
void outputst(int);
int checkst(int);
void findst(int);
void deletest(int);
void resortst(int);
void coverst(int);
int getsno(int);
void lessoninput(int);
int outtofile1(int);
student student::operator=(student &s1);
double value(teacher &te);
protected:
char name[20];
char sex[20];
int age;
int sno;
long tel;
char banji[50];
char lesson[10][50];//用二维的字符数组存储学生所学的课程
};
class teacher
{
public:
double resetscore(double,int);
teacher teacher::operator=(teacher &t1);
void resetworkno(int);
void inputte(char *,char *,int,char *,char *,int);
void outputte(int);
int checkte(int);
void findte(int);
void deletete(int);
void resortte(int);
void resort(int);
void coverte(int);
int getworkno(int);
int outtofile2(int);
double getscore(int);
friend double student::value(teacher &te);//友元成员。声明类student的value作为类teacher的友元函数。
protected:
char name[20];
char sex[20];
int age;
int workno;
char les[50];
char dep[50];
double score;
};
student stu[50];
teacher tea[10];
int student::getsno(int s)
{
return stu[s].sno;
}
void student::resetsno(int s)
{
cin>>stu[s].sno;
}
student student::operator=(student &s1)//用成员函数来实现赋值运算符的重载。
{
strcpy(name,);
sno=;
strcpy(banji,);
strcpy(sex,);
age=;
tel=;
for(int i=0;i<10;i++)
strcpy(lesson[i],[i]);
return *this;
}
void student::inputst(char *xm ,char *xb,int nl,int xh,char *bj,long dh)
{
strcpy(stu[s].name,xm);
strcpy(stu[s].sex,xb);
stu[s].age=nl;
while (xh<100||xh>999) //判断输入的学号是否正确
{
cout<<"您输入的学号不正确,请输入一个三位数的学号"<<endl;
cin>>xh;
while(checkst(xh))
{
cout<<"学号重复!请重新输入:"<<endl;
cin>>xh;
}
}
学生评教管理系统 来自淘豆网m.daumloan.com转载请标明出处.