#include <Address.h>
Public Member Functions | |
Address () | |
Address (string firstName, string lastName, string address, Date birthday) | |
void | setFirstName (string newFirstName) |
void | setLastName (string newLastName) |
void | setAddress (string newAddress) |
void | setBirthday (Date newBirthday) |
string | getFirstName () const |
string | getLastName () const |
string | getAddress () const |
Date | getBirthday () const |
Private Attributes | |
string | firstName |
string | lastName |
string | address |
Date | birthday |
This is a basic address class. It will have a first name, a last name and an address fields. They will all be strings. It will have two constructors and a full set of setters and getters.
Address::Address | ( | ) |
This is the default constructor. It simply sets all of the private variables to the empty string, "" and the birthday is set to the default Date.
Address::Address | ( | string | firstName, |
string | lastName, | ||
string | address, | ||
Date | birthday | ||
) |
This is a parameterized constructor. It will set the fields to the values in the parameters.
firstName | - the person's first name |
lastName | - the person's last name |
address | - the person's address |
birthday | - the person's birthday |
string Address::getAddress | ( | ) | const |
This will return the person's address
Date Address::getBirthday | ( | ) | const |
This will return the person's birthday.
string Address::getFirstName | ( | ) | const |
This will return the person's first name
string Address::getLastName | ( | ) | const |
This will return the person's last name
void Address::setAddress | ( | string | newAddress | ) |
This will update the address to the newAddress
newAddress | - the person's new address |
void Address::setBirthday | ( | Date | newBirthday | ) |
This will update the person's birthday, for some reason.
newBirthday | - the person's new birthday |
void Address::setFirstName | ( | string | newFirstName | ) |
This will update the person's first name to the given newFirstName
newFirstName | - the new first name of the person. |
void Address::setLastName | ( | string | newLastName | ) |
This will update the person's last name to the given newLastName
newLastName | - the person's new last name. |
|
private |
This is the person's address. It should be thought of as simply their street address, but could also contain their city, state and zip.
|
private |
This is the person's first name. In this case, the first name might be more than one word.
|
private |
This is the person's last name. In this case, the last name might be more than one word.