Assume that two int constants,FIRST_YEAR and LAST_YEAR have already been declared and initialized with year values (like 2009, 2014), along with a double variable oil that has been initialized with the number of barrels of oil consumed in Canada in the year given by FIRST_YEAR.

Respuesta :

Answer:

#include <iostream>

using namespace std;

int main()

{

int count;

double oil=10.88;

int FIRST_YEAR=2009,LAST_YEAR=2014;

count = FIRST_YEAR;

do

{

cout << count << ": " << oil << endl;

oil *= 1.20;

count++;

} while ( count <= LAST_YEAR );

return 0;

}

Explanation:

  • Declare the required variables.
  • Use a do-while loop that runs from first year to last year .
  • Display count of oil .
  • Increment oil by 20%  and count by 1.