Mr. Tunan needs a directory that contains the following information.
(a) Name of a person
(b) Address
(c) Telephone Number
(d) Mobile Number
(e) Head of the family
He also needs a functionality to search the information of any person. Now develop a solution
using C++ for Tunan where you need to use a constructor to insert the information and a friend
function to show the output.
Here is program:
class Person
{
public:
Person(string name,string address,string phonenumber,string mobilenumber,string head)
{
this->name = name;
this->address = address;
this->phonenumber = phonenumber;
this->mobilenumber = mobilenumber;
this->head = head;
}
private:
string name;
string address;
string phonenumber;
string mobilenumber;
string head;
};
Comments
Leave a comment