⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpp9.h

📁 程序功能: 1 管理员开设课程; 2 学生可以选择课程; 3 学生注册; 4 教师注册; 5 教师给选自己课程的学生给成绩; 6 管理员对学生成绩进行管理; 7 学生能够查询通过密码自己
💻 H
字号:
#if !defined(CPP9_H)
#define CPP9_H
#include <fstream.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream.h>
#include<iomanip.h>
#include<vector>
#include"password.h"
#include"course.h"
class teacher;
#define ASK(p) do{	\
	p = new Student;	\
	if (p == NULL) {cout << "memory fail!" << endl; exit(-1);}	\
	}while(0)

static struct shorts{
	char name[16];
	double ave;
}sm[10]={{" ",0}};

static struct bads{
	char no[16];
	char name[16];
    course co[5];
	double ave;
}bad[10];

class Student
{
private:
    char no[16];
	char name[16];
	password pw;
	course co[5]; 
	double ave;
	Student *next;
	int menu_select(void);
public:
	static int count;

	Student();
	~Student();
	Student *input(Student *,course *const);
	Student&operator=(Student&s);
	void display(Student *);
	void save(Student *);
    Student *load(Student *);
	void handle_menu(Student *);
	Student *delete_record(Student *);
	void short_record(Student *);
    Student *bad_record(Student *top);
	void  Student::find_record(Student *);
	course*Getco(){return co;}
	char*Getna()
	{
		return name;
	}
	char*Getno()
	{
		return no;
	}

void SetScore(course co,double m)
{
   co.SetScore(m);
}
void setave(Student*top)
{
	Student*p=top;
    cout<<" kdfjls"<<endl;
    double sum=0.0;
	int i=0;
	while(p!=NULL)
    { i=0; 
	  sum=0.0;
	    while(1)
		{
		 if(p->co[i].Getname()[0]=='0')break;
		 cout<<p->co[i].Getscore()<<endl;;
         sum+=p->co[i].Getscore();
		 i++;
        }
    p->ave=sum/i;
	cout<<p->ave<<" ave"<<endl;
	p=p->next;
	}
}
Student*Getnext(){return next;}

	friend ostream &operator << (ostream &os, Student &ob);
	friend istream &operator >> (istream &is, Student &ob);
    
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -