// definition of the class student. Each student has a name and average.
//
// Here the print method is declared virtual!

//
// notice the ifdef below. This makes sure that this class is only
// defined once, even if a file includes this file more than once
// (anything that includes both compsci.h and bio.h would do this!)




#ifndef _STUDENT_H
#define _STUDENT_H


#include <string.h>
#include <iostream.h>

class student {
private:
  char *name;
  double average;

public:
  // default constructor intializes everything to nothing...
  student() {
    name=NULL;
    average=0.0;
  }


  // constructor that accepts a name and average
  student( char *s, double x) {
    name = new char[ strlen(s)+1];
    strcpy(name,s);
    average=x;
  }

  // destructor must free up memory used for the name
  ~student() {
    delete[] name;
  }


  // prints itself out
  virtual void print() = 0;

  void printstu() 
  { 
      cout << "Name: " << name << endl; 
      cout << "Average: " << average << endl; 
    } 

};



#endif _STUDENT_H

