//File : LongHomework1.cpp (programming challenge 10 Reimplemented with class) //Author : Andre Long //Due : August 25, 2004 //Description : This program lets the user enter a full or partial name and search for a predefined //string which matches the user input #include #include using namespace std; class matchMachine { private: string PhoneNumList[11]; public: string userString; matchMachine( ) { PhoneNumList[0] = "Becky Warren, 678-1223"; //initialize array with constructor PhoneNumList[1] = "Joe Looney, 586-0097"; PhoneNumList[2] = "Geri Palmer, 223-8787"; PhoneNumList[3] = "Lynn Presnell, 887-1212"; PhoneNumList[4] = "Holly Gaddis, 223-8878"; PhoneNumList[5] = "Sam Wiggins, 486-0998"; PhoneNumList[6] = "Bob Kain, 586-8712"; PhoneNumList[7] = "Tim Haynes, 586-7676"; PhoneNumList[8] = "Warren Gaddis, 223-9037"; PhoneNumList[9] = "Jean James, 678-4939"; PhoneNumList[10]= "Ron Palmer, 486-2783"; } ~matchMachine() { } void seeker( ) //function definition { int line; int position=0; string x = " "; for ( line = 0; line <11; line++ ) { if ( PhoneNumList[line].find(userString ) != string::npos )//standard sentinel constant { //for the "find" member function for this Microsoft cout<< PhoneNumList[line] <>Fisher.userString; //user input Fisher.seeker(); //call function cout<<"\n"; return 0; }