c language please include a h file and 2 cpp files World pop

c++ language. please include a .h file and 2 cpp files
World population has grown considerably over the centuries. Continued growth could eventually challenge the limits of breathable air, drinkable water, arable cropland and other precious resources. There is evidence that growth has been slowing in recent years and that world population could peak some time this century, then start to decline. For this exercise, research world population growth and its growth rate (the percentage by which it is likely to increase this year). Write a program that calculates world population growth each year for the next 75 years, using the simplifying assumption that the current growth rate will stay constant. Print the results in a table. The first column should display the year from year 1 to year 75. The second column should display the anticipated world population at the end of that year. The third column should display the numerical increase in the world population that would occur that year. Using your results, determine the year in which the population would be double what it is today, if this year\'s growth rate were to persist.

Solution

main.cpp

//System libraries
#include <iostream>
#include <iomanip>

using namespace std;

//Global constants

//Function prototypes

//Execution begins here
int main(int argc, char** argv) {
//Declare variables
  
float pop = 7000000000;
float rate = 0.01;
float increase = 0;
int x = 1;

cout << \"Year\\tPopulation\\tIncrease\" << endl;
for( int y = 2012; y <= 2087; y++ )
{
cout << fixed << setprecision(0) << y << \"\\t\" << pop << \"\\t\" << increase << endl;
increase = pop * rate;
pop += increase;
if ( pop > 14000000000 )
{
while( x > 0 )
{
cout << \"Population floatd at end of \" << y << endl;
x--;
}
}

}

//Exit stage right
return 0;
}

c++ language. please include a .h file and 2 cpp files World population has grown considerably over the centuries. Continued growth could eventually challenge t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site