Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help! Needing good program that will compile. Thank You! You have been co

ID: 3659971 • Letter: P

Question

Please help! Needing good program that will compile. Thank You!

You have been contracted by Adcock Forest Products to produce a basic data input, edit, calculate volumes, and display details for a Forest Inventory System. Your C++ program should be modular (see the specified function table), contain no global variables, be clear and concise, have meaningful data names, and informative comments.

Overview of Program Logic

Input is entered via the key board and consists of the following data for each sample tree:

Data Input Variables

Explanation / Answer

Input is entered via the key board and consists of the following data for each sample tree: Data Input Variables Variable Name treeNo speciesCode dbh totalHt Total Volume Calculation Total volume of an individual tree is a function of dbh, species, and total height and has the following formula. totalVol = b0 + b1 (dbh)2 ( totalHt) b0 and b1 are regression coefficients for determining volume. Their values are determined by the two digit species code. To keep things simple, our C++ variables names for the coefficients are b0 and b1. Tables Location Species[6] speciesDes[6] b 0[6] b1[6] 0 11 Loblolly Pine 1.2446 .002165 1 12 White Pine 0.000 .002364 2 13 Red Pine 2.0822 .002046 3 21 White Oak .7316 .001951 4 22 Red Oak 1.6378 .002032 5 23 Other Oak .7554 .002174 Example of total volume calculation Given: speciesCode = 13 dbh = 10.2 totalHt = 80 totalVol = 2.0822 + .002046 * 10.2 * 10.2 * 80 ; totalVol = 19.111 cubic feet Tree Data Constants and Calculated Results Variable Name Data Type treeNo int speciesCode int speciesDesc[6] string dbh float totalHt int. totalVol double Species[6] int b0[6] double b1[6] double noTrees int avgTotVol double Function Description getTreeNo Input tree number, input must be type int and > 0 and less than 200 or = 999. A value of 999 terminates input. Input is to be a do/while loop. Function is return by value. getSpeciesCode Species code is type int and must be valid and found in the species table. Input is a do/while loop. Function is return by value. getDbh Values are type float and must be greater than or equal to 5.0 and no greater than 50.6 inches. Is a return by value function. getTotHt Values are type int and can range from 24 to 160. Total height is always measured as the closest even integer. For example, 131 would not be a valid measurement whereas 132 would be. A return by value function. calcTotVol Calculate total volume (type float) using supplied formula. Output is 3 decimal places to the right of the decimal. Return by value function. Your report should look similar to the following. Feel free to make the format a little more attractive and even up the spacing. The report is to be stored on report.dat external data file. Forest Inventory Detail Edit and Volume Calculation Tree No. Species Description DBH Tot. Ht. Tot. Vol. 123 11 Loblolly Pine 5.8 120 9.984 124 12 White Pine 10.2 140 32.575 125 22 RedOak 15.6 142 71.858 Total trees measured = 3 Average total volume = 38.199 #include #include using namespace std; class dat { public: int tno,sc,db,ht,vol; int te; float sum; void getip() { couttno; if(tno==999) exit(0); coutsc; coutdb; coutht; coutvol; disp(); } void favg(int i,dat a[]) { sum=0; for(te=0;te