実験課題4

Exercise 4(課題4) Show the execution result of the simulation program with new Mustard class and its complete source code. In this simulation, Mustard supposes to satisfy following constraints:

  • the reproductive rate is 52 percent,
  • the string symbol is *,
  • the other properties are same to Grass class.

Follow instruction below to modify the simulation program.

  1. create new class named Mustard class in the project Simulation01 by inheriting Life class.
  2. modify Mustard class to fit above constraints.
  3. modify main method to locate Mustard object with index 25 in initial space.
  4. modify main method to change simulation periods to 20 years (240th months)
  5. take a screenshot of the execution result.

(課題3のプロジェクトSimulation01に対して、Life クラスを継承して、以下の要件を満たした菜の花を表すMustardクラスを作成し、作成したMustardオブジェクトを初期空間のインデックス25に配置させて、20年間シミュレーションさせなさい。その後、Mustardクラスとmainメソッドのソースコードと実行結果のスクリーンショットを報告しなさい。

  • 繁殖成功率は52%とする。
  • 菜の花を表す文字列は*とする。
  • それ以外の振る舞いは、Grassクラスと同じである。)