実験課題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
Grassclass.
Follow instruction below to modify the simulation program.
- create new class named
Mustardclass in the projectSimulation01by inheritingLifeclass. - modify
Mustardclass to fit above constraints. - modify
mainmethod to locateMustardobject with index 25 in initial space. - modify
mainmethod to change simulation periods to 20 years (240th months) - take a screenshot of the execution result.
(課題3のプロジェクトSimulation01に対して、Life クラスを継承して、以下の要件を満たした菜の花を表すMustardクラスを作成し、作成したMustardオブジェクトを初期空間のインデックス25に配置させて、20年間シミュレーションさせなさい。その後、Mustardクラスとmainメソッドのソースコードと実行結果のスクリーンショットを報告しなさい。
- 繁殖成功率は52%とする。
- 菜の花を表す文字列は
*とする。 - それ以外の振る舞いは、
Grassクラスと同じである。)