📄 class.h
字号:
#pragma once
#ifndef _CLASS_H_
#define _CLASS_H_
#include <list>
#include <algorithm>
#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<<"CLname= "<<name<<", CLid= "<<id<<", CLtotal= "<<total<<endl;
list<Student>::iterator iBegin = students.begin();
list<Student>::iterator iEnd = students.end();
while(iBegin!= iEnd)
{
(*iBegin).printStudent();
iBegin++;
}
}
#endif
protected:
public:
string name; //班级名称
int id;
int total; //学生总数
list<Student>students; //学生
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -