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

#title prime number or not, to find prime numbers upto any number say "n" e...

to find prime numbers upto any number say "n" entered by user

Strings, write a c program to find input string using strlen(), strcpy(), s...

write a c program to find input string using strlen(), strcpy(), strcat(),strncat(), strcmp().

Data Handling in computers, though the ascii is called 7-bit code. why do w...

though the ascii is called 7-bit code. why do we use 8-bits to represent a character?

Beti, how is a beti a beti

how is a beti a beti

Padovan string, write a program that counts the number of occurrences of th...

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college

C, find area uder the curve y=f(x) between x=a and x=b

find area uder the curve y=f(x) between x=a and x=b

Explain the preprocessor directives, The Preprocessor Directives A prep...

The Preprocessor Directives A preprocessor directive which starts with a hash '#' ,is an instruction to the preprocessor, which acts on the source code before the compilation p

Pointer, how to use a pointer variable?

how to use a pointer variable?

Arrays, how to avoid duplicates strings in an array

how to avoid duplicates strings in an array

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