Assignment 7 - Constructing the World Population

due  November 20th

The purpose of this assignment is to give you practice using constructors and destructors.


Program Overview

The goal of this assignment is to create a partial model of a population system, emulating the aging and dying of a population.


Program Requirements

Class Descriptions

The Date class is used to represent calendar dates.  As a minimum, the class must contain:
The Human class must contain at least:
The Population class must contain:
float rollTheDice(unsigned short age)
{
    return static_cast<float>(age)*(rand()%100)/10000.;
}

Assumptions

Date TODAY;        // Make sure you define this after your define the Date class
unsigned DaysPerMonth[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
const string NAMES[] =
{
    "Anh-Dao","Gia","Sam","Aaron","Michael","Neel","John","Rocky",
    "Mashaal","Emmett","Xuefeng","Richard","Amir","Christopher","Thomas","Viet",
    "Sanjit","Johnny","Ehsan","Raul","Fawzan","Sahil","William",
    "Jtwoeight","Emil","Taeyang","Alvin","Duc Huy","Phudit","Ethan","Dat",
    "Yong Yu","Thai Anh Dong","Peter","Mohammad","Joe","Jiazhi","Edgar","Henry"
};


The main() function

You are required to use this main():

int main()
{
    const int OriginalPopulationSize = 39;

    srand(time(0));
    Population World(OriginalPopulationSize);
    World.print();

    // let time pass until half of the world's Population dies
    do
    {
        TODAY.letTimePass();
        World.examinePopulation();
    }
    while (World.getNumberLiving() > OriginalPopulationSize/2);

    World.print();
}

Program Output

Your output should look similar to the following.  

-----------------------------------------------
Today is 08/14/17
Anh-Dao was born on 08/07/28 is 89
Gia was born on 09/10/55 is 61
Sam was born on 02/01/20 is 97
Aaron was born on 11/28/48 is 68
Michael was born on 03/31/64 is 53
Neel was born on 06/10/64 is 53
John was born on 07/04/81 is 36
Rocky was born on 09/27/91 is 25
Mashaal was born on 01/25/27 is 90
Emmett was born on 05/23/96 is 21
Xuefeng was born on 01/07/90 is 27
Richard was born on 08/02/66 is 51
Amir was born on 02/07/58 is 59
Christopher was born on 12/22/86 is 30
Thomas was born on 09/05/05 is 11
Viet was born on 08/29/59 is 57
Sanjit was born on 07/28/41 is 76
Johnny was born on 07/23/89 is 28
Ehsan was born on 09/29/87 is 29
Raul was born on 05/20/59 is 58
Fawzan was born on 09/14/99 is 17
Sahil was born on 02/24/58 is 59
William was born on 05/16/64 is 53
Jtwoeight was born on 06/10/86 is 31
Emil was born on 03/07/79 is 38
Taeyang was born on 08/06/53 is 64
Alvin was born on 09/01/18 is 98
Duc Huy was born on 05/11/98 is 19
Phudit was born on 12/14/72 is 44
Ethan was born on 01/09/35 is 82
Dat was born on 02/06/32 is 85
Yong Yu was born on 12/25/18 is 98
Thai Anh Dong was born on 12/29/28 is 88
Peter was born on 01/01/58 is 59
Mohammad was born on 12/30/04 is 12
Joe was born on 01/29/19 is 98
Jiazhi was born on 02/28/41 is 76
Edgar was born on 02/06/41 is 76
Henry was born on 07/01/05 is 12
-------------------------------------------------
05/15/18 Anh-Dao died at the age of 89
05/15/18 Aaron died at the age of 69
05/15/18 Michael died at the age of 54
05/15/18 Mashaal died at the age of 91
05/15/18 Sahil died at the age of 60
05/15/18 Ethan died at the age of 83
05/15/18 Dat died at the age of 86
05/15/18 Yong Yu died at the age of 99
05/15/18 Jiazhi died at the age of 77
05/15/18 Edgar died at the age of 77
08/05/18 Sam died at the age of 98
08/05/18 Alvin died at the age of 99
08/05/18 Thai Anh Dong died at the age of 89
08/05/18 Joe died at the age of 99
10/15/18 Raul died at the age of 59
03/31/19 Neel died at the age of 54
03/31/19 Viet died at the age of 59
03/31/19 Peter died at the age of 61
05/30/19 Taeyang died at the age of 65
10/11/20 Gia died at the age of 65
-----------------------------------------------
Today is 10/11/20
John was born on 07/04/81 is 39
Rocky was born on 09/27/91 is 29
Emmett was born on 05/23/96 is 24
Xuefeng was born on 01/07/90 is 30
Richard was born on 08/02/66 is 54
Amir was born on 02/07/58 is 62
Christopher was born on 12/22/86 is 33
Thomas was born on 09/05/05 is 15
Sanjit was born on 07/28/41 is 79
Johnny was born on 07/23/89 is 31
Ehsan was born on 09/29/87 is 33
Fawzan was born on 09/14/99 is 21
William was born on 05/16/64 is 56
Jtwoeight was born on 06/10/86 is 34
Emil was born on 03/07/79 is 41
Duc Huy was born on 05/11/98 is 22
Phudit was born on 12/14/72 is 47
Mohammad was born on 12/30/04 is 15
Henry was born on 07/01/05 is 15
-------------------------------------------------