For this project we are going to be extending our basic address and address book classes to be a little more functional. We will be exploring the uses of arrays as a storage unit and their limitations. Specifically, we are going to be learning how to move elements around within the array to make space for new element and how to "remove" elements by sliding down.
The details for the project are in the Project 4 API and you should be sure to read them closely to make sure you know what you need to do.
The basic algorithm for sliding up to make a space at a given location are as follows:
Go to one past the last location within the array where data is stored
Move the element that is one lower in index into the position where you are
Stop when you reach the desired location.
The basic algorithm for sliding down to remove an element at a given location are as follows:
Go to the location where you want to remove the element
For every element but the last one, move the element that is next down to where you are
Stop when you are 1 away from the last element in the array
The biggest change from this project and the labs is how we are storing the data. Instead of storing the data at the end of the array, you are going to loop over the array and find the place where the new address goes. We are going to be using ascending alphabetical order. When the spot where it goes is found, you can use the sliding up idea to make a "hole" for the data to go.
We are also going to be doing a remove. To remove, we go to the location where we want to take the data out, then you get a copy of the data to return and use the sliding down idea to "remove" the data from the array.
There really is no input format for this project. You should write a main that will make an address book and add some address, remove some address, etc. to test the functionality.
This is a sample output for what display address would look like for 3 made up addresses.
First Last Address Birthday
A A AAA 01/01/2014
B B BBB 01/01/2014
C C CCC 01/01/2014
You do not need to match the spacing within a line. You need at least 1 space between each column of output.
This is due April 17 by 11:55PM
Zip up your Date.h, Date.cpp, Address.h, Address.cpp, AddressBook.h and AddressBook.cpp and turn them into Web-CAT