// File: person2.h
//
// A simple class derivation.  Second version.

#ifndef _person_h
#define _person_h

#include <iostream.h>
#include <iomanip.h>
#include "bstring2.h"

class Person {
public:
   Person() : name(), age(0) {}

   Person(const BString& bs, int n)
      : name(bs), age(n)
      { /* do nothing */ }

   virtual void id() {
      cout << name << " age=" << age << endl ;
   }

   BString name ;
   int age ;        // in years
} ;


class Student : public Person {  // public derivation of Person
public:

   Student(const BString& bs, int n, int y, float g)
      : Person(bs,n), year(y), gpa(g)
      { /* do nothing */ }

   virtual void id() {
      cout << "Student: " << name << " age=" << age
           << " year=" << year << " gpa=" << gpa << endl;
   }

   int year ;       // freshman, sophomore, junior or senior
   float gpa ;      // grade point average
} ;


class Faculty : public Person {  // public derivation of Person
public:
    Faculty(const BString& bs, int n, int y)
       : Person(bs,n), experience(y)
       {}

   virtual void id() {
      cout << "Faculty: " << name << " age=" << age
            << " experience=" << experience << endl;
   }

    int experience ;    // years as faculty
} ;

#endif

