Question: . Modify your previous program so that the user can enter the total number acres and the number of uncut acres. The reforestation rate will
. Modify your previous program so that the user can enter the total number acres and the number of uncut acres. The reforestation rate will remain fixed at 0.02. Your program will display the initial parameters, e.g, total number of acres, number of uncut acres, and the reforestation rate. The program will compute and display the number of years it will take until the number of acres cut will be completely renewed. [Note: In one year the number of reforested acres may be less than the total number of acres, while the next year the number of reforested acres may actually exceed the original total number of acres. That means, it is unlikely that at the end of the last year you will find that the forest has reached the exact size at which it started. Beware of off-by-one type errors, i.e., a program incorrectly reports a number that, in this case, reports a year that is one year too early or one year too late.]
The code needs to be in C
The only thing i cant get is for the code to stop going in an infinite loop
This is the code i have right now
E int main (int argc, cha char arg t argv int years; float rate Tb, Tbr, Ta printf "Enter the number of acres before the cut scanf ("%f", &Tb); printf ("Enter the number of acres after the cut: scanf ("%f", &Ta); years 03 rate 0.02 while year Tb Ta Ta rate years; printf ("After %d years %f acres have regrown to f acres ', years, Ta, Tb); always last 3 lines of main printf Inpress enter to quit:"); getchar return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
