Answered step by step
Verified Expert Solution
Question
1 Approved Answer
o This function uses a pointer to fill in the structure variable declared in main. o Data input by the user must be checked so
o This function uses a pointer to fill in the structure variable declared in main. o Data input by the user must be checked so that .All real values must be greater than 0.0 (use the function getPositiveValue from lab 5). The maximum uncut acres must be less than the total acres of the forest. The minimum uncut acres must be less than the maximum uncut acres. . . - The reforestation rate must be between 0 and 1 (exclusive, i.e. cannot be 0 or 1) . Function calculateTableData The parameters of this function consist of a pointer to a structure variable of type FOREST and the necessary parameters to access and update the arrays declared in the function main. Do not use symbolic constants for the dimensions of the arrays, but parameters (this makes the function general to handle arrays of any dimension) In addition to a loop to pass through the array (or arrays), use a nested loop to compute the number of vears for total reforestation for a given value of uncut acres. o o Function displayTable The parameters of this function consist of a pointer to a structure variable of type FOREST and the necessary parameters to access and update the arrays declared in the function main. Do not use symbolic constants for the dimensions of the arrays, but parameters (this makes the function general to handle arrays of any dimension) o o This function first displays the forest information (see the sample output). o It then displays the contents of the array(s) in table form. o Please respect the output format such as the number of digits in the fraction part of the real numbers To answer this question, please provide 1) The source code of your program (DO NOT insert the source code into your assignment document, PDF file) Insert the output for the test cases shown in the table on the next page into your assignment document. Also show an output that shows how invalid input data is treated. 2) The following table gives the output for three tests cases (i.e. three ranges of time) - Name Total Acres Uncut Acres Min Uncut Acres Max Reforestation Rate Incr Forest 1 Forest 2 Forest 3 15000 300 5000 0.05 247.37 22676 1000 10000 0.10 473.68 58732 5000 20000 0.15 789.47 Years toUncut reforest Acres Uncut YearstoUncut reforest Acres Years to reforest Acres 1300.00 2 547.37 3 794.74 4 1042.11 51289.47 6 1536.34 7 1784.21 8 2031.58 9 2278.9:5 102526.32 11 2773.68 12 3021.05 13 3268.42 14 3515.79 15 3763.16 16 4010.53 17 4257.9 18 4505.26 19 4752.63 20 5000.00 33 5000.00 29 578947 26 6578.95 24 7368.42 22 8157.89 21 8947.37 19 9736.84 18 10526.32 1711315.79 16 12105.26 15 12894.74 14 13684.21 13 14473.68 13 15263.16 12 16052.63 11 16842.11 11 17631.58 10 18421.05 10 19210.53 9 20000.00 811000.00 18 68 1473.68 61 1947.37 55 2421.05 12894.74 47 3368.42 44 3842.11 41 4315.79 39 4789.47 37 5263.16 35 5736.84 33 6210.53 32 6684.21 30 7157.89 29 7631.58 28 8105.26 26 8573.95 25 9052.63 24 9526.32 23 10000.00 16 15 13 12 12 10 10
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started