用C++写的一个简单学籍管理系统
源代码在线查看: class.h
#pragma once
#ifndef _CLASS_H_
#define _CLASS_H_
#include
#include
#include "student.h"
class Class
{
public:
Class(const char *,int =-1 );
Class(const Class &);
~Class();
const int getId()const;
const int getTotal()const;
const string getName()const;
void setId(const int );
void setName(const char *);
void addStudent(Student &);
bool deleteStudent( Student &);
bool deleteStudent( int );
void setCompareFlag( COMPARE );
void sort();
float getSumScoreOfClass();
float getSumScoreOfCourse(const Course&);
float getPassRateOfCourse(const Course &);
float getAvgScoreOfCourse(const Course &);
int getStudentNumberOfCourse(const Course &);
void write( ostream& );
void read( istream & );
bool operator==(const Class &);
void printBase();
void printDetail();
#ifdef _DEBUG_
void printClass()
{
cout list::iterator iBegin = students.begin();
list::iterator iEnd = students.end();
while(iBegin!= iEnd)
{
(*iBegin).printStudent();
iBegin++;
}
}
#endif
protected:
public:
string name; //班级名称
int id;
int total; //学生总数
liststudents; //学生
};
#endif