#include #include "phone_book.h" using namespace std; int main ( ) { // Every test prints out the number of phone numbers in the book; PhoneBook phoneBook; cout << "Test 1: Operations on an empty book" << endl; cout << "Total size of book = " << phoneBook.numNumbers ( ) << endl; cout << "Size of area code ( 909 ) = " << phoneBook.numAreaCodeNumbers ( 909 ) << endl; cout << "Number of phone numbers with area code ( 909 ) and prefix 234 = " << phoneBook.numAreaCodeAndPrefixNumbers ( 909, 234 ) << endl; cout << "--------------------------------------------------------" << endl; cout << "Test 2: Inserting first phone number" << endl; phoneBook.insertPhoneNumber ( 909, 345, 1111 ); phoneBook.print ( ); cout << "Total size of book = " << phoneBook.numNumbers ( ) << endl; cout << "--------------------------------------------------------" << endl; cout << "Test 8: Searching for a phone number that does exist" << endl; cout << "Searching for 909-345-1111...." << flush; if ( phoneBook.search ( 909, 345, 1111 ) ) { cout << "found" << endl; } else { cout << "not found" << endl; } cout << "Total size of book = " << phoneBook.numNumbers ( ) << endl; cout << "--------------------------------------------------------" << endl; cout << "Test 9: Searching for a phone number that does not exist" << endl; cout << "Searching for 909-345-9876...." << flush; if ( phoneBook.search ( 909, 345, 9876 ) ) { cout << "found" << endl; } else { cout << "not found" << endl; } cout << "Total size of book = " << phoneBook.numNumbers ( ) << endl; cout << "--------------------------------------------------------" << endl; return 1; }