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

  Program to display the original value

For each value read, your program should display the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to the nearest thousandth.

  The main method must repeatedly have the use

After the method is defined, the main method must repeatedly have the user enter 3 integers, call the triangleType method and display the return type. Be sure not to have an infinite loop by allowing the user to quit.

  Draw a uml diagram of each of the shapes

Draw a UML diagram of each of the Shapes, Rectangle and Square classes using the code that has been provided. Complete this using the examples that have been provide in the lecture slides.

  Write a static method named showtwos

Write a static method named showTwos

  Project is for designing and developing a college

project is for designing and developing a college registration program. write a java program to register students for a

  Create a pair of programs a client and a server to

create a pair of programs a client and a server to distribute the functions of the library you developed. the client

  Create a book class

Create a Book class. In addition to properties of author and isbn, with setters/getters, the Book should override Object's base method "boolean equals(Object)" and have a "boolean validate()" method.

  Implement a program to reverse the digits

Write a method, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For example, the value of reverseDigit(12345) is 54321.

  Java program to decide whether integer is perfect number

For example, 6 is a perfect number because 6 = 1 + 2 + 3. Write a Java program that decides whether integer is a perfect number.

  Write a program that reads a number in feet

Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters. INPUT and PROMPTS.The program prompts for the feet with the message "Enter a value for feet:

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  Write a class lines containing a static method

Write a class Lines containing a static method dashedLine to draw dashed lines, so it can write:

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