Assignment 8 - Constructing the World Population

due November 17th

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

Update 11/13: The required size member was removed from the Human class.


Program Overview

The goal of this assignment is to create a partial model of a population system, simulating 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.f;
}

Assumptions

Date TODAY;        // Make sure you define this after your define the Date class

const string NAMES[] =
{
    "Fadak","Adis","Kia","Adam","Ran","Jason","Brian","Hin Hang",
    "Swati","Alaxendar","Robert","Samar","Thi Thu Vy","Salomon","Marian","Nicolas",
    "Brian Ha","Wanjia","Dolly","Trien Bang","Suraj","Bereket","Ben",
    "Victor","Xinru","Zheng","Ken","Jason Kai","Ryan","Seyedamirhossei","Arrzu",
    "Nimra","Brian Ndiaye","Le Ngoc","Pham Bao Bao","Xuan Yen Tram","Kuangzhong","Joseph",
    "Het","Isha","Ahmad","Mehui","Tarandeep","Minrou","Lauren","Trang","Victoria",
    "An","Vinh","William","Benjamin","Hsin-Chieh","Jiasheng","Siyun"
};


The main() function

You are required to use this main():

int main()
{
    Population World;
    World.print();

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

    World.print();
}


Program Output

Your output should look similar to the following.  
================================================
Today is 08/05/2020
Fadak was born on 02/11/1920 is 100
Adis was born on 07/24/1970 is 50
Kia was born on 05/05/1937 is 83
Adam was born on 07/21/1992 is 28
Ran was born on 06/25/1972 is 48
Jason was born on 01/19/1963 is 57
Brian was born on 06/05/1951 is 69
Hin Hang was born on 05/18/2000 is 20
Swati was born on 10/26/1993 is 26
Alaxendar was born on 12/24/1986 is 33
Robert was born on 08/15/1935 is 84
Samar was born on 01/21/1997 is 23
Thi Thu Vy was born on 09/28/1983 is 36
Salomon was born on 01/26/1966 is 54
Marian was born on 04/10/1947 is 73
Nicolas was born on 05/06/1921 is 99
Brian Ha was born on 03/14/1928 is 92
Wanjia was born on 09/11/1952 is 67
Dolly was born on 03/20/1933 is 87
Trien Bang was born on 11/19/1934 is 85
Suraj was born on 09/06/2008 is 11
Bereket was born on 12/26/1959 is 60
Ben was born on 09/07/1930 is 89
Victor was born on 06/02/1920 is 100
Xinru was born on 10/19/1920 is 99
Zheng was born on 11/25/1953 is 66
Ken was born on 09/12/1967 is 52
Jason Kai was born on 03/30/1971 is 49
Ryan was born on 12/26/1973 is 46
Seyedamirhossei was born on 06/21/1974 is 46
Arrzu was born on 11/30/1934 is 85
Nimra was born on 06/26/1979 is 41
Brian Ndiaye was born on 06/10/1960 is 60
Le Ngoc was born on 08/04/1951 is 69
Pham Bao Bao was born on 02/12/1925 is 95
Xuan Yen Tram was born on 07/08/1974 is 46
Kuangzhong was born on 04/10/1990 is 30
Joseph was born on 01/02/1992 is 28
Het was born on 08/22/1966 is 53
Isha was born on 02/02/1947 is 73
Ahmad was born on 08/02/1998 is 22
Mehui was born on 03/11/1985 is 35
Tarandeep was born on 10/03/2005 is 14
Minrou was born on 01/18/2003 is 17
Lauren was born on 05/21/1968 is 52
Trang was born on 10/08/1932 is 87
Victoria was born on 06/15/1961 is 59
An was born on 02/10/1941 is 79
Vinh was born on 05/09/1997 is 23
William was born on 10/21/1938 is 81
Benjamin was born on 12/11/1989 is 30
Hsin-Chieh was born on 09/08/1995 is 24
Jiasheng was born on 06/04/2009 is 11
Siyun was born on 09/07/2009 is 10
================================================
06/29/2021 Victor died at the age of 101
10/29/2021 Robert died at the age of 86
10/29/2021 Nicolas died at the age of 100
10/29/2021 Pham Bao Bao died at the age of 96
02/04/2022 Kia died at the age of 84
02/04/2022 Marian died at the age of 74
02/04/2022 Dolly died at the age of 88
02/04/2022 Arrzu died at the age of 87
03/01/2022 Trien Bang died at the age of 87
03/01/2022 Ben died at the age of 91
03/01/2022 Xinru died at the age of 101
05/08/2022 Brian Ha died at the age of 94
12/23/2024 Fadak died at the age of 104
12/23/2024 Brian died at the age of 73
12/23/2024 William died at the age of 86
05/21/2025 Zheng died at the age of 71
11/22/2027 Isha died at the age of 80
11/22/2027 Trang died at the age of 95
02/19/2029 Wanjia died at the age of 76
02/19/2029 An died at the age of 88
10/07/2030 Le Ngoc died at the age of 79
11/09/2032 Brian Ndiaye died at the age of 72
08/24/2037 Victoria died at the age of 76
08/13/2038 Salomon died at the age of 72
02/09/2040 Bereket died at the age of 80
07/15/2040 Ken died at the age of 72
01/23/2042 Het died at the age of 75
================================================
Today is 01/23/2042
Adis was born on 07/24/1970 is 71
Adam was born on 07/21/1992 is 49
Ran was born on 06/25/1972 is 69
Jason was born on 01/19/1963 is 79
Hin Hang was born on 05/18/2000 is 41
Swati was born on 10/26/1993 is 48
Alaxendar was born on 12/24/1986 is 55
Samar was born on 01/21/1997 is 45
Thi Thu Vy was born on 09/28/1983 is 58
Suraj was born on 09/06/2008 is 33
Jason Kai was born on 03/30/1971 is 70
Ryan was born on 12/26/1973 is 68
Seyedamirhossei was born on 06/21/1974 is 67
Nimra was born on 06/26/1979 is 62
Xuan Yen Tram was born on 07/08/1974 is 67
Kuangzhong was born on 04/10/1990 is 51
Joseph was born on 01/02/1992 is 50
Ahmad was born on 08/02/1998 is 43
Mehui was born on 03/11/1985 is 56
Tarandeep was born on 10/03/2005 is 36
Minrou was born on 01/18/2003 is 39
Lauren was born on 05/21/1968 is 73
Vinh was born on 05/09/1997 is 44
Benjamin was born on 12/11/1989 is 52
Hsin-Chieh was born on 09/08/1995 is 46
Jiasheng was born on 06/04/2009 is 32
Siyun was born on 09/07/2009 is 32
================================================