// Program from Etter, pg 99, no. 10.. // Timber regrowth. A problem in timber management is to determine // how much of an area to leave uncut so that the harvested portion is // reforested withing a certain perio. It is assumed that reforestation // takes place at a known rte per year depending on climate and soil // conditions. A reforstation equation expresses the growth as a function // of the amount of timber standing after harvesting, and the reforestation // rate. // For example, if 100 acres are left stading after harvesting, and // the reforestation rate is 0.05, then 100 + 0.05 x 100 acres are // forested at the end of the first eyar. At the end of the second year, // the number of acres forested is 105 + 0.05 x 105, or 110.25 acres. // Assume that there are 14,000 acres with 2,500 acres uncut and that the // reforestation rate is 0.02. Print a table showing the number of acres // reforested at the end of each year, for a totoal of 20 years. // 10. Let the user enter number of acres to be reforested; output number of // years required to reforest that number of aces. Everything else // is unchanged (initial number of arres and reforestation rate). #include int main () { double Acres, Total; int Years=0; Acres = 2500; cout << "Enter the total number of acres to be reforested." << endl; cin >> Total; while ( Acres <= Total ) { Acres = Acres + 0.02 * Acres; Years++; } cout << "Years needed to reforest " << Total << " acres is " << Years << endl; return 0; }