The design of the contacts/*
Basic requirements:
Define the date class, including at least (date) (month) (year);
Define the person class, at least, including name, gender and date of birth;
Define staff (staff) class, derived from the person class, at least including telephone, address, postal code, E-mail, QQ number and category (for example: the classmates, friends, etc.),
Functional requirements:
1, design menu select functionality;
2, the input functions: the input information, and saved to a file;
3, the query function:
1) based on name, telephone precise query personnel information;
2) according to address fuzzy query personnel information;
3) according to the category query personnel information
4, according to the names of personnel information output
5, can modify the personnel information according to the name, phone
6, can according to the name, telephone deleted personnel information
*/
# include
# include
# include
# include
# include
using namespace std;
The class date
{
Private:
Int year, month, day.
Public:
Date () {}
The date (int a, b int, int) c: year, (a) the month (b), day (c)
{
Cout & lt; <"WWW" & lt;
The date (date & amp; M)
{
Year=m.y ear;
The month=m.m onth.
Day=m. ay;
}
Void set_date ()
{
Cout & lt; <"Please enter the date of birth:" & lt;
}
Void show_date ()
{
Cout & lt; <"Date of birth is:" & lt;
To date () {}
};
The class person
{
Private:
String name;
String sex;
The date birthday;
Public:
The person () {}
Person (string x, string y) : name (x), sex (y), birthday ()
{
Cout & lt; <"With and function has been called" & lt;
Void set_person ()
{
Cout & lt; <"Please input your name:" & lt;
Cout & lt; <"Please enter the gender:" & lt;
Birthday. Set_date ();
}
Void show_person ()
{
Cout & lt; <"Name is:" & lt;
}
To the person (s)
{
Cout & lt; <"Aaa" & lt;
Void set_name (string g)
{
Name=g;
}
String get_name ()
{
return name;
}
};
Class staff: public person
{
Private:
String telephone;
String address;
Int post_code;
String mailbox;
String qq;
String category;
The person people;
Public:
The staff () {}
Staff (string x, string y, string tel, string add, string mai, int pos, string q, string cat) : person (x, y), telephone (tel), address (add), post_code (pos), mailbox (mai), qq (q), category (cat)
{
}
Void set_staff ()
{
People. Set_person ();
Cout & lt; <"Please enter the phone number:" & lt;
Cout & lt; <"Please enter the address:" & lt;
Cout & lt; <"Please enter the zip code:" & lt;
Cout & lt; <"Please enter the email:" & lt;
Cout & lt; <"Please enter the QQ number:" & lt;
Cout & lt; <"Please enter the category:" & lt;
}
Void set_telephone (string BBB)
{
Telephone=BBB;
}
String get_telephone ()
{
Return the telephone;
}
Void set_address (string add)
{
Address=add;
}
String get_address ()
{
The return address.
}
Void set_category (string cat)
{
Category=cat;
}
String get_category ()
{
Return the category;
}
Void show_staff ()
{
People. Show_person ();
Cout & lt; <"The phone number is:" & lt;
};
The class stafftool
{
Public:
Friend class staff;
Void show_menu that demonstrates ()
{
Cout & lt; <- welcome to the use of address book management system - "& lt;
vector
vector
vector
Int search_staff ()//2. According to the name or telephone query information
{
Int h;
The string s, k;
Long len.
Len=v. considering ();
Cout & lt; <"Please enter a search method: 1. The name lookup 2 phone number lookup" & lt;
If (h==0)
{
Cout & lt; <"Wrong!"
}
Else if (h==1)
{
Cout & lt; <"Please enter a name to find:" & lt;
For (int I=0; I & lt; V. considering (); I++)
{
If (v [I] get_name ()==s)
{
Cout & lt; <"Information is:" & lt;
}
The else
{
Cout & lt; <"No such person!"
}
}
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull