|C++ project help|
I'm doing a rolodex project for a C++ course. I'm ready to test some code. I need help on how to hardcode the rolodex entries, so I don't have to type them each time.
"show(...) takes an ostream as a parameter, iterates through all the cards from beginning to end, invoking each card's show() method, and passing the ostream parameter. The Rolodex show() doesn't do any actual output - it just iterates through the collection and requests each card to display its contents by calling its show() member function. The current card remains unchanged."
void Rolodex:: Show()
for ( iter = nCard.begin(); iter != nCard.end(); iter++ )
iter = nCard.begin();
void Card::displayCard(ostream &out)
out<<endl<<"First name = "<<first;
out<<endl<<"Last name = "<<last;
out<<endl<<"Address = "<<address;
out<<endl<<"Occupation = "<<occupation;
out<<endl<<"Phone Number = "<<phonenumber;
"'list' can call Rolodex::show(...) to display the entire rolodex"
"Use the following information to provide the initial information to demonstrate the
functionality of your rolodex program. You can hardcode these entries into your rolodex
initialization in main() to simulate reading the information from a file"
First Last Occupation Address Phone
Tony Hansen Writer 12 E. St. NY, NY 33333 555-9999
Jon Smyth Computer Hardware CMU 555-1324
Alonza Heard Mechanic 123 Anyplace Ave 555-5678
Jen Reyes Graphic artist 325 Oak Rd 555-4950