// definition of the class bio Each bio is a student // and also has a list of organisms they know about // #include #include #include "student.h" // bio inherits from student class bio: public student { private: char *orgs; public: // default constructor intializes everything to nothing... // note that the base class student has the default // constructor called automatically bio() { orgs=NULL; } // constructor that accepts a name and average and organisms // note that we have to explicitly call the // constuctor for class student or the default will be called! bio( char *n, char *o, double x) : student(n,x) { orgs = new char[ strlen(o)+1]; strcpy(orgs,o); } // prints itself out, uses the student print method to do this. void print() { cout << "Biology Student" << endl; student::print(); // call base class print() cout << "Organisms: " << orgs << endl; } };