Lab 12  Version L12
Basic Address Class
Address.h
Go to the documentation of this file.
1 #ifndef ADDRESS_H
2 #define ADDRESS_H
3 
4 #include <string>
5 
6 using std::string;
7 /**
8 This is a basic address class. It will have a first name, a last name and an address fields.
9 They will all be strings. It will have two constructors and a full set of setters and getters.
10 */
11 class Address
12 {
13 private:
14  /**
15  This is the person's first name. In this case, the first name might be more than one word.
16  */
17  string firstName;
18  /**
19  This is the person's last name. In this case, the last name might be more than one word.
20  */
21  string lastName;
22  /**
23  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.
24  */
25  string address;
26 public:
27  /**
28  This is the default constructor. It simply sets all of the private variables to the empty string, ""
29  */
30  Address();
31  /**
32  This is a parameterized constructor. It will set the fields to the values in the parameters.
33  @param firstName - the person's first name
34  @param lastName - the person's last name
35  @param address - the person's address
36  */
37  Address( string firstName, string lastName, string address );
38 
39  /**
40  This will update the person's first name to the given newFirstName
41  @param newFirstName - the new first name of the person.
42  */
43  void setFirstName( string newFirstName );
44  /**
45  This will update the person's last name to the given newLastName
46  @param newLastNAme - the person's new last name.
47  */
48  void setLastName( string newLastName );
49  /**
50  This will update the address to the newAddress
51  @param newAddress - the person's new address
52  */
53  void setAddress( string newAddress );
54 
55  /**
56  This will return the person's first name
57  @return the person's first name.
58  */
59  string getFirstName();
60  /**
61  This will return the person's last name
62  @return the person's last name
63  */
64  string getLastName();
65  /**
66  This will return the person's address
67  @return the address
68  */
69  string getAddress();
70 };
71 
72 #endif