Write code to implement constructor and assessors, C/C++ Programming

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

Posted Date: 3/23/2013 6:19:53 AM | Location : United States







Related Discussions:- Write code to implement constructor and assessors, Assignment Help, Ask Question on Write code to implement constructor and assessors, Get Answer, Expert's Help, Write code to implement constructor and assessors Discussions

Write discussion on Write code to implement constructor and assessors
Your posts are moderated
Related Questions
What about Virtual Destructor? describe it.

In this Lab you will code 8086 assembler equivalents (Virgo) for common C control flow instructions. This will give you an appreciation for how control flow is implemented in assem

Ask question #Minimum 100 words awhat is the pre condition for binary searching ccepted#

Record separation problem Let us assume that a particular database program manages a simple mailing list which consists of one record for each person on the list, and a number of f

how to convert a general tree into binary tree with example


What is MIME? MIME - Multi-purpose Internet Mail Extensions. MIME types signifies a standard way of classifying file types over Internet. Browsers and Web servers have


Input Format: First line starts with T, which is the number of test cases. Each test case contains a string (S). Output Format: For each test case print the minimum number of ch

how to pass array