#include#include edit();};void base::set_base_information(){ string pn,fn,ln; cout<<"enter first name

Posted on

#include#include edit();};void base::set_base_information(){ string pn,fn,ln; cout<<"enter first name

#include#include #include#include#includeusing namespace std;//first make a “phonebokk.txt” blanck file in your computer…//string fileadress=”C:UserslenovoDesktopphonebook.txt”;               //”C:\Users\arman\Desktop\phonebook.txt”;//In the line above you should change the address according to the location you’ve built your “.txt”fileclass base{ protected: string phonenumber; string firstname; string lastname;public: void set_base_information(); void searchphone(); void edit();};void base::set_base_information(){ string pn,fn,ln; cout<<"enter first name : "<>fn; cout<<" enter last name : "<>ln; cout<<" enter phone number : "<>pn; phonenumber = pn; firstname = fn; lastname = ln; ofstream file1;  file1.open(“phonebook.txt”, ios :: app); file1<> vari; cout << " "; ifstream file1; file1.open("phonebook.txt"); /* You should wirte each "if case" body below*/ if (vari == 1) { string lnsearch; cin>>lnsearch; int i ; while(!file1.eof()) { string temp = ” “; string temp1 = ” “; string temp2 = ” “; string temp3 = ” “; getline(file1,temp); getline(file1,temp1); getline(file1,temp2); getline(file1,temp3); if (temp==lnsearch) { cout<>pnsearch; int i ; while(!file1.eof()) { string temp = ” “; string temp1 = ” “; string temp2 = ” “; string temp3 = ” “; getline(file1,temp); getline(file1,temp1); getline(file1,temp2); getline(file1,temp3); /*cout< editname; while (!file1.eof()) { string temp=” “; getline(file1,temp); editname.push_back(temp); } string fname , lname; cout<<" please enter first name and last name of contact you want to edit ... "<>fname; cout<<" lastname : "<>lname; for(int i=0;i>newfn; cin>>newln; cin>>newpn; cin>>newea; editnamei=newfn; editnamei+1=newln; editnamei+2=newpn; editnamei+2=newea; } } ofstream file2; file2.open(“phonebook.txt”); for(int j=0 ; j>ea; email=ea; ofstream file1;  file1.open(“phonebook.txt”, ios :: app); file1<> counter; if (counter == 1) { ob.set_base_information(); ob.set_derived_information(); cout << " "; goto lablename1; } else if (counter == 2) { ob.searchphone(); cout << " "; int i; cout << "1. Continue   2.exit: "; cin >> i; if (i == 1) { goto lablename1; } else { exit; } } else if (counter == 3) { ob.edit(); cout << " "; goto lablename1; } else { system("cls"); cout << "Wrong Input Try again.. "; goto lablename2; } system("pause"); return 0;}

admin
Author

x

Hi!
I'm James!

Would you like to get a custom essay? How about receiving a customized one?

Check it out