Claculations not displaying as I would like

This is a homework assignment. I am only looking for some direction not for someone to do the work. I am to create a program that will display the current world population, multiply it by the current growth rate, display the yearly sums and the amount of increase in 3 columns for a 75 year span of time. So far my program compiles and runs but don't know how to get my third column (the amount of increase) to run and display, Do I have to put another loop in for this? If so will it display to the right of the yearly totals?
Below is what I have so far. Thank you in advance for any assistance.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
double increase;
double pop = 6775235700;
double rate = .012;
// display headers
cout << "Year" << setw( 30 ) << "Population at End of Year" << setw( 40 ) << "Amount of Increase" << endl;

cout << fixed << setprecision( 2 );

for ( int year = 1; year <= 75; ++year )
{
increase = pop * pow(1.0 + rate, year );

cout << setw( 4 ) << year << setw( 40 ) << increase << endl;
} //end for

cout << "Population Doubles in Year 59" << endl;
system("pause");
} //end main
Thanks anyway I think I figured it out. I inserted
// display amount of increase
amtIn = rate * increase, year;

//display year and amount
cout << setw( 4 ) << year << setw( 20 ) << increase << setw( 40 ) << amtIn << endl;
} //end for

within the loop. It seems to work.
Hope someone is available next time.
Topic archived. No new replies allowed.