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","Ashley","John","Rocky",
    "Sophia","Emmett","Xuefeng","Richard","Amir","Christopher","Thomas","Viet",
    "Sanjit","Johnny","Ehsan","Tri","Fawzan","Sahil","William",
    "Thuy","Emil","Taeyang","Alvin","Duc Huy","Phudit","Ethan","Dat",
    "Yong Yu","Thai Anh Dong","Peter","Li Yu","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 11/13/17
Anh-Dao was born on 07/05/87 is 30
Gia was born on 01/07/96 is 21
Sam was born on 04/12/76 is 41
Aaron was born on 09/10/48 is 69
Michael was born on 01/03/17 is 100
Ashley was born on 08/28/99 is 18
John was born on 11/20/03 is 13
Rocky was born on 05/20/80 is 37
Sophia was born on 06/27/54 is 63
Emmett was born on 05/01/45 is 72
Xuefeng was born on 12/28/70 is 46
Richard was born on 12/03/23 is 93
Amir was born on 10/17/46 is 71
Christopher was born on 12/27/04 is 12
Thomas was born on 12/17/99 is 17
Viet was born on 09/16/64 is 53
Sanjit was born on 11/15/67 is 49
Johnny was born on 03/21/95 is 22
Ehsan was born on 08/21/42 is 75
Tri was born on 11/09/95 is 22
Fawzan was born on 12/22/73 is 43
Sahil was born on 05/23/29 is 88
William was born on 12/20/77 is 39
Thuy was born on 09/20/44 is 73
Emil was born on 07/13/01 is 16
Taeyang was born on 09/01/28 is 89
Alvin was born on 02/05/93 is 24
Duc Huy was born on 03/04/81 is 36
Phudit was born on 02/28/02 is 15
Ethan was born on 08/24/65 is 52
Dat was born on 09/29/04 is 13
Yong Yu was born on 07/15/37 is 80
Thai Anh Dong was born on 03/21/79 is 38
Peter was born on 05/06/59 is 58
Li Yu was born on 03/07/75 is 42
Joe was born on 05/29/06 is 11
Jiazhi was born on 11/30/68 is 48
Edgar was born on 08/08/77 is 40
Henry was born on 12/24/33 is 83
-------------------------------------------------
11/06/18 Aaron died at the age of 70
11/06/18 Michael died at the age of 101
11/06/18 Thuy died at the age of 74
09/28/19 Sahil died at the age of 90
09/28/19 Taeyang died at the age of 91
12/31/19 Richard died at the age of 96
12/31/19 Amir died at the age of 73
12/31/19 Henry died at the age of 86
11/28/21 Ehsan died at the age of 79
01/03/22 Sophia died at the age of 67
01/03/22 Yong Yu died at the age of 84
01/03/22 Peter died at the age of 62
11/12/22 Viet died at the age of 58
12/14/22 Emmett died at the age of 77
12/14/22 Ethan died at the age of 57
10/15/26 Jiazhi died at the age of 57
02/06/29 Xuefeng died at the age of 58
05/19/31 Fawzan died at the age of 57
04/25/32 Sanjit died at the age of 64
07/19/32 William died at the age of 54
-----------------------------------------------
Today is 07/19/32
Anh-Dao was born on 07/05/87 is 45
Gia was born on 01/07/96 is 36
Sam was born on 04/12/76 is 56
Ashley was born on 08/28/99 is 32
John was born on 11/20/03 is 28
Rocky was born on 05/20/80 is 52
Christopher was born on 12/27/04 is 27
Thomas was born on 12/17/99 is 32
Johnny was born on 03/21/95 is 37
Tri was born on 11/09/95 is 36
Emil was born on 07/13/01 is 31
Alvin was born on 02/05/93 is 39
Duc Huy was born on 03/04/81 is 51
Phudit was born on 02/28/02 is 30
Dat was born on 09/29/04 is 27
Thai Anh Dong was born on 03/21/79 is 53
Li Yu was born on 03/07/75 is 57
Joe was born on 05/29/06 is 26
Edgar was born on 08/08/77 is 54
-------------------------------------------------