Write java program to simulate a ecosystem

Assignment Help JAVA Programming
Reference no: EM131001981

Write a java program to simulate an ecosystem containing two types of creatures, bears andfish. The ecosystem consists of a river, which is modeled as a relatively large array. Each cell of array should contain an Animal object, which can be a Bear object, a Fish object, ornull. In each time step, based on a random process, each animal either attempts to move into an adjacent array cell or stay where it is. If two animals of the same type are about to collide in the same cell.

Then they stay where they are, but they create a new instance of that type of animal, which is placed in a random empty (i.e., previously null) cell in the array. If a bear and a fish collide, however, then the fish dies (i.e., it disappears). Use actual object creation, via the new operator, to model the creation of new objects and provide a visualization of the array after each time step.

Reference no: EM131001981

Questions Cloud

Culate an exact numerical value for s : For death during the deferred period, can be purchased for a single premium of 2200. Calculate an exact numerical value for S.
What is k-nearest neighbor data mining algorithm : Natural language processing (NLP), a subfield of artificial intelligence and computational linguistics, is an important component of text mining. What is the definition of NLP? What are the five steps in the backpropagation learning algorithm?
Discuss the convergence of european nations : Discuss the convergence of European nations after 1945 and compare this phenomenon with the current trend of divergence that currently exists between Europe and the United States.
What is the cost of the guarantee to the manufacturer : Assuming that interest is a constant 5% and that reimbursement is made at the end of the year of failure, what is the cost of this guarantee to the manufacturer, as a percentage of the purchase price?
Write java program to simulate a ecosystem : Write a java program to simulate an ecosystem containing two types of creatures, bears andfish. The ecosystem consists of a river, which is modeled as a relatively large array. Each cell of array should contain an Animal object, which can be a Bea..
What is the new single premium : For a certain insurance contract, on (50), the death benefit for the first year. If the value of q50 is changed to 0.25, while all other value of qx are unchanged, what is the new single premium?
Find a formula for p assuming premiums are returned : Find a formula for P, assuming: (a) premiums are returned without interest; (b) premiums are returned with interest.
How human piety and sanctity are conceived and recognized : Symbols: their origin and meaning in different religious traditions. Authority over tradition: how it is established, and the role it plays in different religious traditions. Saintliness: how human piety and sanctity are conceived and recognized
Record the transactions-using t-accounts : Darlene Cook Company engaged in the following transactions during the month of July: July 1 Acquired land for $10,000. The company paid cash.

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Create a scatterplot visualization

Create a Scatterplot visualization that reads data from a comma-separated text file. The visualization code should be written in Java using Processing.

  Write a program that assigns seats on an airplane

Prepare a program that teaches arithmetic to a young child. The program tests subtraction and addition. Write a program that assigns seats on an airplane.

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Java program for input of numbers only

Edit Java program for input of numbers only. If the user inputs a letter the program must abort with a messegae like "Program aborted by user". Please explain the code.

  The burn and distance traveled

The Burn and distance traveled and the "meters to go" should appear on two lines as shown in the sample output. Note that this print should be done within the while loop.

  Create java program to simulate the operation of a bank atm

write a Java program to simulate the operation of a bank ATM (cashpoint) system for payment and deposit on an account. In order to make the system fairly simple there is only one bank account and there are 5 cards that can be used to deposit or wi..

  Write a program that will calculate monthly pay

Write a program that will calculate monthly pay and expenses for a commercial utility sales person. Sales employees in this company are paid monthly. Each employee is paid a base pay of $1,000 and 9½ % commission on sales. The company deducts 18% of..

  Traditionally-nutrition programs were targeted to indigent

Traditionally, nutrition programs were targeted to the indigent and poor populations in developing countries. Many of today's Americans are malnourished also, but they are glutted with a wealth of unhealthy foods and require a multidisciplinary appro..

  Method definition to count and then return the number

Write a nested loop structure that prints out the following number series: 111 112 121 122 211 212 221 222. The innermost loop may have only one print statement and no literal string output except a space (" ").

  Write a method called alldigitsodds that returns whether

write a method called alldigitsodds that returns whether every digit of a positive integer is odd. return true if the

  Create a circle class

create acircle class, which has one field, the radius. the class should contains two constructors: a no-argument constructor that set the radius to zero, and a constructor that takes a parameter to set the radius.

  Create a new json view

Add code to your controller to check which view to display.  For this assignment, there will be a URL parameter named "format".  When the value of the "format" parameter is "json" display the JSON view, otherwise display the regular HTML JSP view.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd