#include <iostream>
#include <string>
#include "Person.h"
#include <cassert>
usingnamespace std;
// CONSTRUCTORS
/*!
* @function Person constructor, 0 to 3 arguments
* @param string fname - first name for new person
* @param string lname - last name for new person
* @param int A - age for new person
* @pre A >= 0, fname.size() >= 1, lname.size() >= 1
* @return a new Person, initialized with provided data
*/
Person::Person(string fname, string lname, int A)
{
assert(A >= 0);
setAge(A);
assert(fname.size() >= 1);
setFirstName(fname);
assert(lname.size() >= 1);
setLastName(lname);
}
// MODIFICATION MEMBER FUNCTIONS
/*!
* @function setFirstName
* @param string newName, the new first name
* @pre newName.size() >= 1
* @post the Person's first name data is updated
*/
void Person::setFirstName(string newName)
{
assert(newName.size() >= 1);
fname = newName;
}
/*!
* @function setLastName
* @param string newName, the new last name
* @pre newName.size() >= 1
* @post the Person's last name data is updated
*/
void Person::setLastName(string newName)
{
assert(newName.size() >= 1);
lname = newName;
}
/*!
* @function setAge
* @param int newAge, the new age value
* @pre newAge >= 0
* @post the Person's age data is updated
*/
void Person::setAge(int newAge)
{
assert(newAge >= 0);
newAge = A; // stub; does nothing
}
/*!
* @function agePerson
* @post the Person's age is increased by 1
*/
void Person::agePerson()
{
// stub; does nothing
}
// // ACCESSOR MEMBER FUNCTIONS
/*!
* @function getFirstName
* @return the Person's first name
*/
string Person::getFirstName() const{
// stub
return fname;
}
/*!
* @function getLastName
* @return the Person's last name
*/
string Person::getLastName() const{
// stub
return lname;
}
/*!
* @function getAge
* @return the Person's age
*/
int Person::getAge() const
{
// stub
return A;
}