#include #include using namespace std; char blah[11]; char fname[50]; char lname[50]; char addr[56]; char street[56]; char zipcode[6]; char book, another; void fnAdd(); void BYE(); int main ( int argc, char *argv[] ) { start: int cor; fnAdd(); cor: std::string phone = blah; string phnarea = phone.substr(0, 3); string phnone = phone.substr(3, 3); string phntwo = phone.substr(6, 9); string address = addr; cout<<"Is this information correct?1.Yes 2.No"<< endl; cout<<"\n\t "<< lname <<", "<< fname << endl; cout<<"\t "<< street << endl; cout<<"\t "<< addr <<" " << zipcode<< endl; cout<<"\t "<< phnarea <<"-"<> cor; if (cor==1){ ofstream examplefile ("Database.txt", ios::ate | ios::app); if (examplefile.is_open()) { examplefile<<""<< lname <<", "<< fname << endl; examplefile<<""<< street << endl; examplefile<<""<< addr <<" " << zipcode<< endl; examplefile<<""<< phnarea <<"-"<> book; if(book=='y'||book=='Y'){system("cls"); char buffer[256]; ifstream examplefile ("Database.txt"); if (! examplefile.is_open()) { cout << "Error opening file"; exit (1); } while (! examplefile.eof() ){ examplefile.getline (buffer,100); cout << buffer <> another; if (another=='y' || another=='Y'){goto start;}} else if(book=='N'||book=='n' || another=='n' || another=='n' ){BYE();} return 0; } void fnAdd(){ cout<<"\\-----------------------------/"<< endl; cout<<" What is their first name?\n"; cin.getline (fname, 50); cout<<" What is their last name?\n"; cin.getline (lname, 50); cout<<" What is the street address?\n"; cin.getline (street, 56); cout<<" What is the city/town and state? (city, ST)\n"; cin.getline(addr, 50); cout<<" What is the zipcode?\n"; cin.getline(zipcode, 6); cout<<" What is their PhoneNumber?\n"; cin.getline (blah, 11);} void BYE(){system("PAUSE");system("cls");cout<<"Good bye\n";system("PAUSE");}