Assume that there are 14,000 acres total with 2,500 acres uncut, and that the re
ID: 3627230 • Letter: A
Question
Assume that there are 14,000 acres total with 2,500 acres uncut, and that the reforestation rate is 0.02. Allow the user to enter a number of years. Print a table showing the number of acres forested at the end of each year, with the last year being the input number.Make use of a while-loop ONLY for this assignment.
here's part of my code; i don't know how to integrate the years part.
#include<iostream>
#include<iomanip>
using namespace std;
const double r_rate = 0.02;
int main()
{
// Declare and initialize objects.
double a_f; // a_f is areas forested.
double year;
int a_u(2500); // a_u is areas uncut.
// Set formats.
cout.setf(ios::fixed);
cout.precision(7);
cout << "Please enter # of years";
cin>> year;
while (year >= 1)
{
a_f = a_u + r_rate *a_u;
a_f == year ;
year++;
}
return 0;
}