
/*   File  : person.cpp
 *
 *   Programmer:  A.H.Dawson
 *   Date:        Tuesday January 28th 2003
 *   Status:      Complete
 *
 *  Person
 *       - three protected fields, firstName, lastName and age
 *         (protected means they are accessible by functions of this class
 *          i.e. the base class and also by functions of a derived class
 *          i.e. the Student class)
 *  Functions:
 *     Person:    the default constructor
 *     setFirstName:   sets the firstName
 *     getFirstName:   returns the firstName
 *     setLastName:    sets the lastName
 *     getLastName:   returns the lastName
 *
 *  Student: inherits from Person
 *       -  one private field, studentNumber
 *  Functions:
 *     Student:          the default constructor
 *     setStudentNumber: sets the studentNumber member of a Student object
 *     getStudentNumber: returns the studentNumber member of a Student object
 */

#include <iostream.h>
#include <iomanip.h>
#include <conio.h>


#include "person.h"



/************************************************************************/

/* Constructor Person
*/
Person::Person()
{
	lastName = "No last name yet";
   firstName = "No first name yet";
 	age = 0;
} //end constructor Person


/* sets the firstName of the object
*/
void Person::setFirstName(string str)
{
   firstName = str;
}	//end setFirstName

/* sets the lastName of the object
*/
void Person::setLastName(string str)
{
   lastName = str;
}	//end setLastName

/* returns the firstName of the object
*/
string Person::getFirstName()
{
	return firstName;
}  //end getFirstName

/* returns the lastName of the object
*/
string Person::getLastName()
{
	return lastName;
}  //end getLastName

/************************************************************************/

/* Constructor Student
*/
Student::Student()
  : Person()     // calls base class constructor
{
  studentNumber = "No student number yet";
} //end constructor Student

/* sets the studentNumber of the object
*/
void Student::setStudentNumber(string str)
{
   studentNumber = str;
}	//end setStudentNumber


/* returns the studentNumber of the object
*/
string Student::getStudentNumber()
{
	return studentNumber;
}  //end getStudentNumber
// end of person.cpp

