study the given class specification and answer


Study the given class specification and answer the questions that follow:

class Person

{

private:

  string name;

  int yrBorn;

  int yrDied;  

public:

  Person(string, int, int); // initialize all data members

  int getYrBorn(); // return year born

  int getYrDied(); // return year died

  void display(); // display all private data members

  int yrLived(); // return the difference between yrDied and yrBor

};

(a)  The access  specifiers used in the above class are private and public.  Explain these access specifiers.

(b)  Write code to implement  ALL  the methods found in the above class specification.

(i)  Constructor 

(ii)  Assessors

(iii)  display method 

(iv)  yrLived method

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: study the given class specification and answer
Reference No:- TGS0218926

Expected delivery within 24 Hours