The Canadian Forest Service wants to do a simple simluation of the growth and pruning of forests. Each forest has a name and exactly 10 trees. The trees are planted when they are up to 5' tall, and each tree has a individual growth rate of 50%-100% per year. For the simulation new trees are constructed randomly within these bounds. A forest is reaped (by lumberjacks) on demand - all trees above a specifed height are cut down and replaced with new trees.
The user interface to the simulation must allow the user to:
(D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d No forest (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : n What is the forest name : Sherwood (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d Sherwood 1 : 2.51 (65% pa) 2 : 1.42 (79% pa) 3 : 3.06 (60% pa) 4 : 2.00 (68% pa) 5 : 4.29 (85% pa) 6 : 2.45 (59% pa) 7 : 1.25 (57% pa) 8 : 1.49 (64% pa) 9 : 3.89 (78% pa) 10 : 4.87 (87% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : y (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : y (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : y (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : y (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : y (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d Sherwood 1 : 30.70 (65% pa) 2 : 26.11 (79% pa) 3 : 32.06 (60% pa) 4 : 26.79 (68% pa) 5 : 92.96 (85% pa) 6 : 24.95 (59% pa) 7 : 11.92 (57% pa) 8 : 17.62 (64% pa) 9 : 69.60 (78% pa) 10 : 111.44 (87% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : r What height to reap at : 60 Cut 5 : 92.96 (85% pa) New 5 : 3.61 (89% pa) Cut 9 : 69.60 (78% pa) New 9 : 2.33 (72% pa) Cut 10 : 111.44 (87% pa) New 10 : 2.73 (72% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d Sherwood 1 : 30.70 (65% pa) 2 : 26.11 (79% pa) 3 : 32.06 (60% pa) 4 : 26.79 (68% pa) 5 : 3.61 (89% pa) 6 : 24.95 (59% pa) 7 : 11.92 (57% pa) 8 : 17.62 (64% pa) 9 : 2.33 (72% pa) 10 : 2.73 (72% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : s (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : n What is the forest name : Chippewa (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d Chippewa 1 : 3.71 (54% pa) 2 : 0.47 (68% pa) 3 : 3.92 (59% pa) 4 : 1.88 (78% pa) 5 : 1.01 (91% pa) 6 : 1.88 (80% pa) 7 : 1.38 (57% pa) 8 : 4.23 (54% pa) 9 : 1.14 (53% pa) 10 : 0.77 (56% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : s (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : l What is the forest name : Sherwood (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : d Sherwood 1 : 30.70 (65% pa) 2 : 26.11 (79% pa) 3 : 32.06 (60% pa) 4 : 26.79 (68% pa) 5 : 3.61 (89% pa) 6 : 24.95 (59% pa) 7 : 11.92 (57% pa) 8 : 17.62 (64% pa) 9 : 2.33 (72% pa) 10 : 2.73 (72% pa) (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : q ERROR: Invalid option (D)isplay, (N)ew, (Y)ear, (R)eap, (S)ave, (L)oad, e(X)it : x Goodbye