The rate of growth (or decrease) in world population depends on the average number of children each person has and the average child-bearing age. In the long run, the average individual standard of living decreases as the number of people increases and world resources decrease. This project demonstrates these effects. The code for the top-level class (the driver) in provided for this project and you are to create the driven classes needed for the top-level class to run correctly as described below. Please see the Supplied Solution Components and Sample Runs sections of this assignment for more information.

The 100-year results from the sample runs below suggest the following: Suppose each childbearing couple has 0.16 * (40 - 15) = 4 children, and each adult extracts from nonrenewable environmental resources at a rate of $3,000 per year. Then, the population will increase from 5.2 billion to 8.4 billion, resources will decrease from $1,977 trillion to $815 trillion, and the standard of living (consumption per person) will decrease from ($31 trillion / 5.2 billion) ≈ $5,000 per person per year to ($30 trillion / 8.4 billion people) ≈ $3,600 per person per year. On the other hand, suppose each child-bearing couple were to have only 0.12 * (40 – 15) = 3 children, and each adult extracted from nonrenewable environmental resources at a rate of only $1500 per year. Then, the population would decrease from 5.2 billion to 3.1 billion, nonrenewable resources would decrease from $1,977 trillion to $1,458, and the individual standard of living would improve to ($25 trillion / 3.1 billion people) ≈ $8,000 per person per year. With a lower population, there would be more sustainable resources per person.

Here is the UML class diagram and the description details for each of the other classes driven by the Demographics class that is provided to you: See image.

Government class:

  • The constructor initializes the lostFraction.
  • For each of the three groups of people, the govern method calculates a distribution using the following algorithm: group distribution ← (total distribution)*(group population fraction)
  • Then it calls the earn method in the People class for each group with the corresponding group distribution value as the first argument. It accumulates taxes by summing the values returned by youth, adults, and seniors calls to the earn method and it updates total distribution for the next year with this algorithm: total distribution ← (total taxes)*(1.0 – lostFraction)

Environment Diagram: See image.

Environment class:

  • The constructor initializes sustainableProduction, initialResources, and currentResources (= initialResources).
  • The produce method is called by each of the three groups of People. It computes: extraction ← yieldFactor*extractionExpense* (currentResources/initialResources);
  • This produce method reduces currentResources by the amount of the computed extraction. Then it returns: extraction+(this group's populationFraction)* (total sustainableProduction)

People Diagram: See image.

People class:

  • The constructor initializes youngest age, tax rate, and individual extraction expense.
  • The earn method computes: extractionExpense ← individualExtractionExpense*groupPopulation
  • Then it passes its population fraction and extraction expense to the produce method in the Environment class and gets back a total production, which is the sum of sustainable production and nonrenewable resource extraction with value added to the latter. Each group’s gross income is what it produces plus what’s been distributed to it by the government. This group’s taxes are gross income times the tax rate, and the net income is gross income minus taxes. The earn method returns the computed taxes.
  • The initialize method is a class method. It instantiates the population array and assigns a reference to it to a class variable. Then it steps through each population by age and initializes it with the following rule: if (age < maxAge/2) population[age] ← (long)((1.0-0.02*age)*2x108) else population[age] ← 0
  • While doing this, the method accumulates an initial value for totalPopulation. Then the method asks the user for values of youngest child-bearing age, oldest child-bearing age and the fertility rate in this age range.
  • The simulate method computes aging and death in one year by implementing the following algorithm: for age from max age to age 1 ageFactor ← age/100.0 mortality ← M0+M1*ageFactor+M4*(ageFactor)4 population[age]←population[age-1]*(1.0-mortality)
  • Then it adds new births with the following algorithm: population[0] ← 0 for age from youngest to oldest child-bearing age population[0] ← population[0]+0.5 *population[age]*primeFertility
  • Then it accumulates the number of people in each age group and re-computes the total number of people. It also determines the fraction of people in each age group. Finally, it uses its youth, adults, and seniors reference-variable parameters to reset the total number of people and the population fraction in each of the three People objects.

Sample Runs

A first sample run of the program is shown below. (Note: Bold texts are user input.)

Welcome to a demographic projections simulator!
Please enter the following information:
Youngest child-bearing age (15?): 15
Oldest child-bearing age (40?): 40
Children per year in child-bearing years (0.16?): 0.16
Annual unsustainable extraction in $/person (3000?): 3000
Enter number of years to simulate: 2
Enter first year to output economics: 2
Year #2
Populations:
Youth = 3.2 billion
Adults = 2.0 billion
Seniors = 0.0 billion
Total = 5.2 billion
Consumption: $31 trillion
Taxes: $13 trillion
Resources: $1,977 trillion
Thank you, good bye!

A second sample run of the program is shown below. (Note: Bold texts are user input.)

Welcome to a demographic projections simulator!
Please enter the following information:
Youngest child-bearing age (15?): 15
Oldest child-bearing age (40?): 40
Children per year in child-bearing years (0.16?): 0.16
Annual unsustainable extraction in $/person (3000?): 3000
Enter number of years to simulate: 100
Enter first year to output economics: 100
Year #100
Populations:
Youth = 4.6 billion
Adults = 3.6 billion
Seniors = 0.2 billion
Total = 8.4 billion
Consumption: $30 trillion
Taxes: $13 trillion
Resources: $815 trillion
Thank you, good bye!

A third sample run of the program is shown below. (Note: Bold texts are user input.)

Welcome to a demographic projections simulator!
Please enter the following information:
Youngest child-bearing age (15?): 15
Oldest child-bearing age (40?): 40
Children per year in child-bearing years (0.16?): 0.12
Annual unsustainable extraction in $/person (3000?): 1500
Enter number of years to simulate: 100
Enter first year to output economics: 100
Year #100
Populations:
Youth = 1.4 billion
Adults = 1.5 billion
Seniors = 0.1 billion
Total = 3.1 billion
Consumption: $25 trillion
Taxes: $11 trillion
Resources: $1,458 trillion
Thank you, good bye!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.