Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Canadian Forest Service wants to do a simple simulation of the growth and pruning of forests. Each forest has a name and exactly 10

image text in transcribed
image text in transcribed
image text in transcribed
The Canadian Forest Service wants to do a simple simulation of the growth and pruning of forests. Each forest has a name and exactly 10 trees. The trees are planted when they are 1' 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) or 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: e Display the current forest (with tree heights to 2 decimal places) e Discard the current forest and create a new forest . Simulate a year's growth in the current forest . Reap the current forest of trees over a user specified height, replacing the reaped trees with random new trees * Save the information about the current forest to file (named after the forest) e Discard the current forest and load the information about a forest from a file The user interface must deal with invalid user input in a graceful way Here what a sample run should look like (with the keyboard input shown in italics) (D)isplay, (N)ew, (Year, (Reap, (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, (Year, (Reap, (S)ave , (L)oad, e(X)it : d Sherwood 1 : 4.40 (59% pa ) 2 : 4.62 (69% pa) 3 : 4.99 (76% pa) 4 1.18 (67% pa) 5 2.59 (72% pa) 2.61 (91% pa) 7 : 1.14 (89% pa) 1.42 (77% pa) 9 : 1.91 (90% pa) 10 : 3.58 (53% pa)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago