// File: person.h
//
// A simple class derivation

#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 */ }
      
   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 */ }
      
   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)
       {}
       
   void id() {
      cout << "Faculty: " << name << " age=" << age 
            << " experience=" << experience << endl;
   }
    
    int experience ;	// years as faculty
} ;

#endif

