Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing the two functions into case 2 of the code A problem in timber management is to determine how much of an

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

I need help writing the two functions into case 2 of the code

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 of time. Given that reforestation takes place at a known rate per year (depending on climate and soil conditions) one can make a few helpful estimates. Your job including writing two timber regrowth functions plus a welcome/menu function and an output function. These will go with a main) function (and other functions if/as needed) that will test them Reforestation Model: A reforestation equation expresses annual regrowth as a function of the amount of timber standing and the reforestation rate: NewAcres PreviousAcres + ReforestationRate *PreviousAcres For example, if 100 acres are standing after harvesting and the reforestation rate is 0.05, then 100+ 0.05 100-105 acres are forested at the end of the first year; at the end of the second year it is 105+ 0.05 105 or 110.25 acres. If you repeat this for nyears, you can find the total reforested area after a given period of time. For this program we will be using type double for acreage and reforestation rate variables and type unsigned int for years. alue to the caller. YearsTReforest target area to be reforested. (For example, 2500 acres left standing, a rate of 0.02 and a target of 14,000 acres eventually forested.) It then determines and returns to the caller the number of this function accepts the area left uncut, the reforestation rate, and a . years (an unsigned int) it wil take for the given area to be completely reforested. YOU MUST USE A while LOOP FOR THIS CALCULATION. Looping stops when the number of acres reforested either equals or exceeds the target. (Note: In its final version, this function has no cout statements.) OutputYears > this function is used AFTER YearsToReforest has done its job. It accepts the number of years it will take for the area to be completely reforested as an unsigned int parameter and outputs this value with an appropriate message. int WelcomeAndMenu)1 int directory; cout>directory; return directory; int main() int menuChoice; menuchoice = WelcomeAndMenu( ) ; if(menuChoice--3) cout>maxyears; cout>previousAcres; cout>newAcres; cout"Input reforest rate"endl; cin>>reforestRate; break; default: cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions