Write a Person class with a constructor that accepts the following details:
1. First name
2. Middle name
3. Last name
4. Date of birth (entered in this pattern 22-02-2000)
5. Gender (male, female)
6. Identity number (private attribute)
7. Mobile number (if any)
Provide a method getAge that calculates the persons' age from his date of birth.
If the user provided his mobile number you have to check if it is a valid number with the pattern 999-
999-9999 if not, show him an error message and do not save the number.

Respuesta :

The person class is an illustration of constructors;

Constructors in programs are used to create and initialize valid values to the data members of an object

The Person class

The class and the constructor program written in C++ programming language is as follows:

#include <iostream>

#include <ctime>

#include <string>

using namespace std;

class Person{

The complete program is added as an attachment

Read more about C++ programs at:

https://brainly.com/question/13168905

#SPJ1

Ver imagen MrRoyal
ACCESS MORE