Lab 12
Version L12
Basic Address Class
|
#include <Address.h>
Public Member Functions | |
Address () | |
Address (string firstName, string lastName, string address) | |
void | setFirstName (string newFirstName) |
void | setLastName (string newLastName) |
void | setAddress (string newAddress) |
string | getFirstName () |
string | getLastName () |
string | getAddress () |
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, ""
Address::Address | ( | string | firstName, |
string | lastName, | ||
string | address | ||
) |
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 |
string Address::getAddress | ( | ) |
This will return the person's address
string Address::getFirstName | ( | ) |
This will return the person's first name
string Address::getLastName | ( | ) |
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::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. |