#include<iostream>
#include<string>
using namespace std;
class Advisor
{
int noofMeeting;
};
class Student
{
string name;
int sementsHours;
double average;
public:
//此句不明
Student(string Pname = "noname") :name("pname"), average(0), sementsHours(0) {}
void addCourse(int hours, double grade)
{
double totalgrade = (sementsHours*average + grade);
sementsHours += hours;
average = sementsHours ? totalgrade / sementsHours : 0;
}
void display()
{
cout << "name: " << name << "; hours: " << sementsHours << " ;average: " << average << endl;
}
int gethours()
{
return sementsHours;
}
double getaverage()
{
return average;
}
};
class graduatestudent :public Student
{
Advisor advisor;
int quailfiergrade;
public:
int getquailfiergrade()
{
return quailfiergrade;
}
};
int main()
{
Student ds("LO LEE undergraduate");
graduatestudent gs;
ds.addCourse(3, 2.5);
ds.display();
gs.addCourse(3, 3.0);
gs.display();
system("pause");
return 0;
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。