Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Currently need help answering this question, please follow the steps shown Create class called person. This class has 3 data members as follows: first Name:

image text in transcribed

Currently need help answering this question, please follow the steps shown

Create class called person. This class has 3 data members as follows: first Name: this data member holds the person's first name. lastName: this data member holds the person's last name. birthYear: this data member holds the year the person was born. You need to validate the birth year. Set the birth year to 1900 if a value of less than 1900 is provided and set it to 2017 if a value of more than 2017 is provided. All data members of the class must be private. Make sure you create the appropriate functions to access these data (get and set functions). You need to create a public member function of the class called getAge() which returns the age of the person. The age is calculated as the difference between the current year (2017) and the birth year. Make sure you separate the class interface from the class implementation. Do not forget to use the preprocessor wrappers (#ifndef, #define, #endif). Create a program to test this class. To complete the assignment, you need to submit a header file (class interface), .cpp (class implementation), and your program (.cpp file). Also, you need to submit your application (.exe file)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago

Question

LO1 Understand human resource management and define human capital.

Answered: 1 week ago