// File: main1.C
//
// Simple example of dynamic binding

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


main() {
   Person P("James Bond", 37) ;
   Student S("Peppermint Patty", 7, 1, 1.2) ;
   Faculty F("Newt Gingrich", 53, 12) ;

   Person *ptr ;
   int n ;

   cout << "Pick (1-3): " ;
   cin >> n ;

   if (n == 1) {
      ptr = &P ;
   } else if (n == 2) {
      ptr = &S ;
   } else {
      ptr = &F ;
   }

   ptr->id() ;
}
