Question: Using Java language This problem simulates the percolation of fire in a tree farm starting with the first row on fire. If the tree farm

Using Java languageUsing Java language This problem simulates the percolation of fire in atree farm starting with the first row on fire. If the tree

This problem simulates the percolation of fire in a tree farm starting with the first row on fire. If the tree farm is very dense, percolation will cause most of the trees to burn. If the tree farm is sparse, a smaller percentage of trees will catch and the fire will die out The main method constructs a square 2D array of user specified capacity and density, displays the initial configuration (using some character for tree), ignites the first row, runs the burn algorithm and then displays the final configuration (using some character for burned tree). Report the initial actual percent of trees and after the burn report the percent of trees burned in the fire. Report whether the fire burns out inside the forest or burns through, endangering housing areas. The wind pushes the fire down. Ifa tree is on fire, neighbors on down left, straight down, and down right will also catch. To simplify code, you need only check these three neighbors. The fire does not spread sideways or backwards. In the picture below, the tree (T), once on fire, would burn any trees in the shaded area. Use error-checking loops to ensure valid data. 'A valid capacity is 10 to 30 trees per side A valid tree density is 0.20 to 0.80 Submit screen shots of files from two runs: A 20x20 forest with density 0.45 that burns out A 20x20 forest with density 0.45 that burns through Notes: 1. Random number can be generated using the Random class discussed in Chapter 3 2. The burn algorithm should be encoded as a main method, passed the 2D array. 3. The display algorithm should be encoded as a main method, passed the 2D array. 4. No helper classes need to be written; all code will be done in the application class containing the main method. This problem simulates the percolation of fire in a tree farm starting with the first row on fire. If the tree farm is very dense, percolation will cause most of the trees to burn. If the tree farm is sparse, a smaller percentage of trees will catch and the fire will die out The main method constructs a square 2D array of user specified capacity and density, displays the initial configuration (using some character for tree), ignites the first row, runs the burn algorithm and then displays the final configuration (using some character for burned tree). Report the initial actual percent of trees and after the burn report the percent of trees burned in the fire. Report whether the fire burns out inside the forest or burns through, endangering housing areas. The wind pushes the fire down. Ifa tree is on fire, neighbors on down left, straight down, and down right will also catch. To simplify code, you need only check these three neighbors. The fire does not spread sideways or backwards. In the picture below, the tree (T), once on fire, would burn any trees in the shaded area. Use error-checking loops to ensure valid data. 'A valid capacity is 10 to 30 trees per side A valid tree density is 0.20 to 0.80 Submit screen shots of files from two runs: A 20x20 forest with density 0.45 that burns out A 20x20 forest with density 0.45 that burns through Notes: 1. Random number can be generated using the Random class discussed in Chapter 3 2. The burn algorithm should be encoded as a main method, passed the 2D array. 3. The display algorithm should be encoded as a main method, passed the 2D array. 4. No helper classes need to be written; all code will be done in the application class containing the main method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!