/**
 * Demonstrates Person and Student class by creating a couple instances
 * and printing out the results of various method calls.
 *
 * @author Zach Tomaszewski
 * @version 31 Mar 2008
 */
public class PersonTester {

  public static void main(String[] args) {
    System.out.println("Bob was born in 1980.");
    Person bob = new Person("Bob", 1980);

    System.out.println();
    System.out.println("Person: " + bob);  //runs Person's toString
    System.out.println("Name = " + bob.getName());
    System.out.println("Year of Birth = " + bob.getYearOfBirth());
    System.out.println("Current Age (roughly) = " + bob.getAge());

    //putting a Student object in a Person variable
    bob = new Student("Bob", 1980, 3.0);
    System.out.println();
    System.out.println("Student: " + bob); //run's Student's toString
    System.out.println("Name = " + bob.getName());
    System.out.println("Current Age (roughly) = " + bob.getAge());

    //need to have bob in a Student variable in order to call Student methods
    Student schoolBob = (Student) bob;
    System.out.println("GPA: " + schoolBob.getGPA());

  }

}
