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

Assignment Help:

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


Related Discussions:- Write code to implement constructor and assessors

Setup and source code with nice user interface, Virtual Webcam effects - Se...

Virtual Webcam effects - Setup and Source code with Nice User Interface Project Description: I want a similar webcam effects application which can apply effects to webcam fee

Define functions with arguments and no return values, Define Functions with...

Define Functions with arguments and no return values The calling function will read a data from the terminal and pass it on to called as function and this will work good as the

Araay, create two array names and grade .in first array you have to store t...

create two array names and grade .in first array you have to store thease 10 names 1.a,2.3.r,4.s,5.l,6.k,7.n,8.b,9.z,10.d you have to enter grades for thease students.te program mu

Bitcoin alternative – deployment and modification, I started preparing an a...

I started preparing an alternative cryptocurrency and I am way over my head. I would like help in making modifications to the open source files and then help with deployment. I wil

Control flow, write the program to accept date and to say valid or invalid

write the program to accept date and to say valid or invalid

Where are longjmp and setjmp used in c++, Where are longjmp and setjmp used...

Where are longjmp and setjmp used in C++? -Setjmp and longjmp must not be used in C++. - Longjmp jumps out of the function without unwinding stack. This means that local obj

What is a newline escape sequence, What is a newline escape sequence? -...

What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T

Super ascii string checker, Program which can check the given string is su...

Program which can check the given string is super ascii or not

Explain public and private members, Public, Private and Protected members: ...

Public, Private and Protected members: Class members can either be declared in public','protected' or in the 'private' sections of the class. But as one of the features of OOP i

Pebblemerchant, write a c++ program for pebble merchant

write a c++ program for pebble merchant

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd