AddressBooks  Version 0.1
This is a basic 10 person address book
 All Classes Functions Variables
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AddressBook Class Reference

#include <AddressBook.h>

Public Member Functions

 AddressBook ()
 
Address addressAt (int location) const
 
void addAddress (Address a)
 
Address removeAddressAt (int location)
 
void displayAddresses (std::ostream &out) const
 

Private Member Functions

void slideUp (int loc)
 
void slideDown (int loc)
 

Private Attributes

Address theBook [10]
 
int size
 

Detailed Description

This class will have an array of Addresses of size 10. It will store addresses and return them.

Constructor & Destructor Documentation

AddressBook::AddressBook ( )

This is the constructor. It needs to initialize theBook and the size

Member Function Documentation

void AddressBook::addAddress ( Address  a)

This will add the given address to the book at the location according to the address's last name. We will insert them in ascending, i.e. A-Z, order

Parameters
a- The Address you want added to the end of the address book.
Address AddressBook::addressAt ( int  location) const

This will return the address at the given location. If the location is bad, then the address that is returned is the default address, i.e. Address();

Parameters
location- the location in the address book that you want returned.
Returns
the address that was found at the location, or Address() if location was bad.
void AddressBook::displayAddresses ( std::ostream &  out) const

This will simply display the address in the book to the ostream that is given. Start your display with a header that says: Then on the next line display "First Last Address Birthday" then the first name and last name of the address then comes the address and last on the line is the birthday displayed as MM/DD/YYYY. Repeat for the rest of the addresses.

Parameters
out- the ostream to use for displaying the addresses
Address AddressBook::removeAddressAt ( int  location)

This will remove the address from the address book at the given location. If the location is bad, then the address that is returned is the default address. Otherwise, this will remove and return the address at the given location.

Parameters
location- the location in the address book that you want returned.
Returns
the address that was found at the location, or Address() if location was bad.

The documentation for this class was generated from the following files: