You are viewing our Forum Archives. To view or take place in current topics click here.
C++ input output code stuff
Posted:

C++ input output code stuffPosted:

Shniarfman
  • Challenger
Status: Offline
Joined: Jan 01, 201311Year Member
Posts: 107
Reputation Power: 4
Status: Offline
Joined: Jan 01, 201311Year Member
Posts: 107
Reputation Power: 4
Hello I am new to C++ I'm not asking for an answer to this question, (would be nice) but how I would begin going about setting up a table and a function.Thanks

Description: A problem in timber management is to determine how much of an area to leave uncut so that the harvested area is reforested in a certain period. It is assumed that reforestation takes place at a known rate per year, depending on the climate and soil conditions. A reforestation equation expresses this growth as a function of the amount of timber standing and the reforestation rate. For example, if 100 acres are left standing after harvesting and the reforestation rate is 0.05, then 100 + 0.05 * 100, or 105 acres, are forested at the end of the first year. At the end of the second year, the number of acres forested is 105 + 0.05 * 105, or 110.25 acres.
a) Assume that there are 14,000 acres total with 2,500 acres uncut, and that the reforestation rate is 0.02. Print a table showing the number of acres forested at the end of each year, for a total of 20 years. (Remember, you can use the > in the command line to redirect the output to a file.)
b) Modify the program developed in a) above so that a user can enter the number of years to be used in the table.
c) Modify the program of a) again, this time so that the user can enter the number of total and uncut acres, and the program will determine how many years are required for the number of acres to be completely reforested.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.