Bobby resides on a planet called Bobbland. During the study, scientists have deduced certain things about the interesting life forms on this planet. To finalize the presentation to the science...


Bobby resides on a planet called Bobbland. During the study, scientists have deduced certain things about the interesting life forms on this planet. To finalize the presentation to the science committee, the scientists want you to build an accurate model of how the life forms behave.



  1. All life forms (Bobblandian.java) have energy that scientists have standardized on the scale of 100. Each Bobblandian has a name, a starting energy level of 100, and a temperature of 60 degrees celsius.

  2. All life forms can eat (public void eat(Candy food)).

  3. All life forms can move (public void move(int cm_distance)). The life form loses energy equivalent to half of the cm distance travelled. When energy level cannot take the distance travelled, it will drop to 0 and never negative.

  4. Scientists have further deduced the following:


    1. The life form moving decreases its temperature by 2.5 degrees celsius.

    2. Eating increases its temperature by 5.5 degrees celsius.

    3. Scientists can also measure the energy levels of the life form (public int getEnergy()).

    4. Scientists regularly take the temperature of the life form (public double getTemperature()) to determine when the life form can eat.

    5. Scientists have observed that Bobblandian diet. The points of energy restored depends on the scheme below:


      1. All Bobblandians only eat candies (Candy.java).

      2. If the candy is coloured red (public String getColor()), 10 points are restored, if the temperature after increase is 70 degrees or higher.

      3. For yellow, 20 points are restored, if the temperature after increase is less than 70.

      4. If the candy is neither red nor yellow, the energy restored is randomly set from 0 to 9 no matter the temperature.

      5. If the temperature is not ideal to eat a certain kind of candy, the life form loses 20 points of energy.



  5. Write your own main program that demonstrates all of these by instantiating each of the objects. You are scored through your Object creations and implementation and not your main program.

Oct 26, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here