1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#include <iostream>
using namespace std;
void print_menu(void);
int main()
{
int index=0;
char choice;
string firstname, lastname, nickname, email1, email2, phone1, phone2, address, website, birthday, notes;
print_menu();
cin >> choice;
while (index = choice)
{
if (choice == 'a' || choice == 'A')
{
cout<<"Please enter first name"<<endl;
getline( cin, firstname );
cout<<"Please enter last name"<<endl;
getline( cin, lastname );
cout<<"Please enter nickname"<<endl;
getline( cin, nickname );
cout<<"Please enter email 1"<<endl;
getline( cin, email1 );
cout<<"Please enter email 2"<<endl;
getline( cin, email2 );
cout<<"Please enter phone 1"<<endl;
getline( cin, phone1 );
cout<<"Please enter phone 2"<<endl;
getline( cin, phone2 );
cout<<"Please enter address"<<endl;
getline( cin, address );
cout<<"Please enter website"<<endl;
getline( cin, website );
cout<<"Please enter birthday"<<endl;
getline( cin, birthday );
cout<<"Please enter notes"<<endl;
getline( cin, notes );
cout<<"--------------------DETAILED VIEW--------------------"<<endl;
cout<<"Last Name: "<<firstname<<endl;
cout<<"First Name: "<<lastname<<endl;
cout<<"Nickname: "<<nickname<<endl;
cout<<"Email 1: "<<email1<<endl;
cout<<"Email 2: "<<email2<<endl;
cout<<"Phone 1: "<<phone1<<endl;
cout<<"Phone 2: "<<phone2<<endl;
cout<<"Address: "<<address<<endl;
cout<<"Website: "<<website<<endl;
cout<<"Birthday: "<<birthday<<endl;
cout<<"Notes: "<<notes<<endl;
cout<<"-------------------------------------------------"<<endl;
print_menu();
cin>>choice;
}
}
index++;
system ("PAUSE");
return 0;
}
void print_menu (void)
{
cout<<"--------------------MAIN MENU--------------------"<<endl;
cout<<"[A] add a contact to the address book"<<endl;
cout<<"[D] display all contact sorted by ...."<<endl;
cout<<"[C] display details of contact ...."<<endl;
cout<<"[R] remove contact"<<endl;
cout<<"[F] find contacts matching ...."<<endl;
cout<<"[M] modify contact"<<endl;
cout<<"[E] export to csv format"<<endl;
cout<<"[Q] quit the program"<<endl;
cout<<"-------------------------------------------------"<<endl;
}
|