実験課題5

Exercise 5(課題5) See the section 5.5.1. "Interface" and the section 5.5.2 "Propagation simulation: Abstraction". Show the execution result of the modified project Simulation01 to correspond with Figure 44 by using classes from Figure 39 and complete GenerationPrinter class. Following instruction below to create the program.

  1. add interface Space, Printer by right-clicking the project and selecting 新規 > Javaインタフェース... in the right-click menu.
    1. Right click on the target project. Right click menu for adding Interface in project pane
      Figure:Right click menu for adding Interface in project pane
    2. Complete in New Javaインタフェース dialog and click 終了(F). Specify Interface parameters in ``New Javaインタフェース'' dialog
      Figure:Specify Interface parameters in ``New Javaインタフェース'' dialog
  2. add class GenerationPrinter by the same way.
  3. modify the source code to run this program.
  4. take a screenshot of the execution result.

(5.5.1.節と5.5.2.節をよく読み、課題4の変更を加えたプロジェクトSimulation01に対して、mainメソッドを図50の定義に書き換え、図44の実行結果となるように図39から記載されているクラス・インタフェースを追加・変更して、プログラムを作成しなさい。ここでクラスの継承・実装関係はクラス図である図47に従いなさい。なお、図49に示すGenerationPrinterクラスは不完全のため、各自中略部分を改良すること。その後、GenerationPrinterのソースコードを報告しなさい。また実行結果もスクリーンショットで報告しなさい。なお、インタフェースの追加方法は以下の手順に則ること。

ここでは、インタフェースSpaceを追加する際の手順例を示す。

  1. プロジェクトペインから新たに追加するプロジェクトを選択して、右クリックする。
  2. 右クリックメニューの新規 > Javaインタフェース...を選択する。
  3. New Javaインタフェースダイアログで、クラス名をSpace、パッケージ名をSimulation01として、終了を選択する。
  4. パッケージSimulation01にあるSpace.javaを開いてエディタペインに表示させ、図39のプログラムを適宜変更および追加する。

)