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

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

class Person



  string name;

  int yrBorn;

  int yrDied;  


  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 are the various types of control structures in programming? - Primarily there are 3 types of control structures in programming: Sequence, Selection and Repetition. - Se

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed

how can i make a program with !(not) operator

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

question c

A: The procedure of encoding the parameter types along with the function/method name into a unique name is called as name mangling. The inverse procedure is called demangling. F

The Conditional Expression Operator An alternate method to using a simple if-else construct is the conditional expressions operator, ?:   A conditional expression operato

kirchoff''s law

Literals (Constants) Constants are data storage locations whose address is not accessible for the user. Their value is not altered during the course of the program. Literal