Question: Consider the following (partial) class declaration of an ADT: class Person { public: Person(string n, string a, float s); ~Person(); string getAddress(); void raiseSalary(int r);
Consider the following (partial) class declaration of an ADT:
class Person
{
public:
Person(string n, string a, float s);
~Person();
string getAddress();
void raiseSalary(int r); //percentage by which salary is
//raised, e.g. 5 indicates 5%
friend bool operator == (const Person & p1,const Person & p2);
//returns true if the member variable name is
//the same for both p1 and p2
friend ostream& operator << (ostream& outs, const Person & p);
//each member variable appears on a separate line
private:
string name;
string address;
float salary;
};
Provide only the implementation for the class Person. Implement only the member functions in the given class declaration. There is no need for comments.
| Maximum number of characters (including HTML tags added by text editor): 32,000 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
