麻烦给我这个解释一下最好比较完整

#include
#include
#include
#include
using namespace std;

class Information {
private:
string id, name, cid, cname;
int credit, score;
public:
Information(const string &id, const string &name, const string &cid, const string &cname, int credit, int score)
: id(id), name(name), cid(cid), cname(cname), credit(credit), score(score) {}

const string &getId() const {
    return id;
}

friend ostream &operator<<(ostream &os, const Information &information) {
    os << "id: " << information.id << " name: " << information.name << " cid: " << information.cid << " cname: "
       << information.cname << " credit: " << information.credit << " score: " << information.score;
    return os;
}

void setId(const string &id) {
    Information::id = id;
}

const string &getName() const {
    return name;
}

void setName(const string &name) {
    Information::name = name;
}

const string &getCid() const {
    return cid;
}

void setCid(const string &cid) {
    Information::cid = cid;
}

const string &getCname() const {
    return cname;
}

void setCname(const string &cname) {
    Information::cname = cname;
}

int getCredit() const {
    return credit;
}

void setCredit(int credit) {
    Information::credit = credit;
}

int getScore() const {
    return score;
}

void setScore(int score) {
    Information::score = score;
}

};

static map<int, Information> imap;
static int id = 1;

void push(string sid, string name, string cid, string cname, int credit, int score) {
imap.insert(pair<int, Information>(id++, Information(sid, name, cid, cname, credit, score)));
}

void del(int id) {
imap.erase(id);
}

void searchBySId(string sid) {
int sum = 0;
for (map<int, Information>::iterator item = imap.begin(); item != imap.end(); item++) {
if (item->second.getId() == sid) {
// 统计总分
sum += item->second.getScore();
cout << "编号: " << item->first << " ";
cout << item->second << endl;
}
}
}

void searchByCId(string cid) {
int sum = 0, count = 0, qua = 0;
for (map<int, Information>::iterator item = imap.begin(); item != imap.end(); item++) {
if (item->second.getCid() == cid) {
// 统计总分
sum += item->second.getScore();
count++;
if (item->second.getScore() >= 60) qua++;
cout << "编号: " << item->first << " ";
cout << item->second << endl;
}
}
cout << "该课程平均分为" << ios::fixed << (double) sum / count << endl;
cout << "该课程及格率为" << ios::fixed << (double) qua / count * 100 << endl;
}

void view() {
bool flag = true;
while (flag) {
cout << "1. 添加 \n"
"2. 删除 \n"
"3. 查询学生成绩 \n"
"4. 统计 \n"
"0. 退出" << endl;
int c = 0;
cin >> c;
switch (c) {
case 1: {
cout << "请输入学号(8),姓名,课程编号(5),课程名,学分(0-5),成绩(0-100)" << endl;
string id, na, cid, cna;
int cre, sc;
cin >> id >> na >> cid >> cna >> cre >> sc;
push(id, na, cid, cna, cre, sc);
break;
}
case 2: {
cout << "输入需要删除的信息编号" << endl;
int id;
cin >> id;
del(id);
break;
}
case 3: {
cout << "输入需要查询的学号" << endl;
string sid;
cin >> sid;
searchBySId(sid);
break;
}
case 4: {
cout << "输入需要查询的课程编号" << endl;
string sid;
cin >> sid;
searchByCId(sid);
break;
}
case 0: {
flag = false;
break;
}
default:;
}
}
}

int main() {
view();
return 0;
}

请问你具体要解释什么啊?程序有错?还是代码不懂?