![]() |
CS
139 Algorithm Development Due: Thursday, Sep 20th at 11:59 PM
|
---|
"American Forests’ National Big Tree Program is a conservation movement to locate, appreciate and protect the biggest tree species in the United States. More than 750 champions are crowned each year and documented in our annual publication — the National Register of Big Trees.
For more than 70 years, the goal of the National Big
Tree Program has remained: to preserve and promote the iconic
stature of these living monarchs and to educate people about the
key role that these remarkable trees and forests play in
sustaining a healthy environment." (from the American
Forests Big Tree Registry site: http://www.americanforests.org/our-programs/bigtree/
)
How are the "winners" crowned? Each nominated tree is given a
score based on its girth, height and canopy spread. A formula is
applied which gives each tree a points value:
Total Points = Trunk Circumference (in
inches) + Height (in feet) + ¼ Average Crown Spread (in
feet)
The average crown spread is calculated by taking the largest
spread and the narrowest spread and dividing that total by 2. Here
is a link to a US Forest Service web site with an example: http://www.fs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb5202838.pdf
In this application we are going to help the "Big Tree Hunters" by buiding a Java application that will calculate the Total Points value of a candidate "big tree", which can be used in the nomination process.
Some big trees in Harrisonburg, Virginia:
http://bigtree.cnre.vt.edu/bigtree_detail.cfm?AutofieldforPrimaryKey=1468
http://bigtree.cnre.vt.edu/bigtree_detail.cfm?AutofieldforPrimaryKey=623
(A National Champion)
You will write a single Java program, PA1.java, that must:
Big Tree Report: Common Name: the common name of the tree
Scientific Name: the scientific name of the tree Circumference: the circumference of the tree (in inches) Height: the height of the tree (in feet) Average Crown: the average crown spread of the tree (truncated to the nearest whole foot) Total points: the points for the tree (truncated to the nearest whole point)
Your program should use appropriate data types for the values being input and calculated, and appropriate and meaningful names for all variables and constants.NOTES:
- The parenthetical instructions describe the output values and are not to be output.
- The three blank lines are significant and must be included.
- The colons must line up vertically.
- Each of the 10 lines of output must be terminated with a single newline "\n" character.