谁能帮我改一下这个个C++的错误(天哪,错误太多了)

来源:百度知道 编辑:UC知道 时间:2024/05/16 08:36:41
#include<iostream>
#include<string>
using namespace std;
class cStudent
{
public:
double sum();
double average();
void print();
int get_reg_num();
void set_stu_inf(char,int,double,double,double);
private:
string m_strName;
int m_nReg_Num;
double m_fMath_Grade;
double m_fEnglish_Grade;
double m_fComputer_Grade;
}; //以上代码写在std_head.h 文件里面。
#include<iostream>
#include<string>
#include"std_head.h"
using namespace std;
double cStudent::sum();
{
return(m_fMath_Grade+m_fEnglish_Grade+m_fComputer_Grade);
}
double cStudent::average()
{
return(sum()/3);
}
void cStudent::print()
{
cout<<"***********************************"<<endl;
cout<<"注册号:"<<m_nReg_Num<<endl;
cout<<"姓名: "<<m_strName<<endl;

//我把你写错的地方都加了注释自己看看你哪里错了吧.估计你是刚开始写,一开始能抄这么大的程序来,值得佩服.
#include<iostream>
#include<string>
using namespace std;
class cStudent
{
public:
cStudent(){}
~cStudent(){}
double sum();
double average();
void print();
double get_reg_num(); //这里,声明时使用的是 int ,定义时用的是double,返回类型不一致
void set_stu_inf(string,int,double,double,double);
private:
string m_strName;
int m_nReg_Num;
double m_fMath_Grade;
double m_fEnglish_Grade;
double m_fComputer_Grade;
}; //以上代码写在std_head.h 文件里面。
#include<iostream>
#include<string>
#include"std_head.h"
using namespace std;
double cStudent::sum()//这里,多了个分号.
{
return(m_fMath_Grade+m_fEnglish_Grade+m_fComputer_Grade);
}
double cStudent::average()
{
return(sum()/3);
}
void cStudent::print()
{
cout<<"************************