315 第12章 UML模型的C++实现
area = length * width; return area; }
string getName() { return \ }
}
class Triangle : Shape{ private:
double length; double height; public:
Triangle(double l, double h){ length = l; width = w; }
double compArea() {
area = 0.5 * length * height; return area; }
string getName() {
return \ } }
class Student{ public:
Schedule* theSchedule;
Student(){
theSchedule = new Schedule[5]; } }
class Schedule{ public:
Student theStudent; Schedule(){} }