ソースを参照

Update README.md

Git-Leon 6 年 前
コミット
63e0039d71
コミット者のEメールアドレスに関連付けられたアカウントが存在しません
共有1 個のファイルを変更した9 個の追加0 個の削除を含む
  1. 9
    0
      README.md

+ 9
- 0
README.md ファイルの表示

228
 ### Part 11.2 - Test `Alumni` Class
228
 ### Part 11.2 - Test `Alumni` Class
229
 * Write a test class which ensures that each `Student` in the `Alumni` class has been taught `1200` hours upon injection of the `Alumni` dependency.
229
 * Write a test class which ensures that each `Student` in the `Alumni` class has been taught `1200` hours upon injection of the `Alumni` dependency.
230
 * Ensure the `numberOfHoursTaught` has been evenly distributed amongst each of the instructors.
230
 * Ensure the `numberOfHoursTaught` has been evenly distributed amongst each of the instructors.
231
+
232
+* **Tip:** How to derive `numberOfHoursTaught` dynamically
233
+```java
234
+int numberOfInstructors = instructors.size();
235
+int numberOfStudents = students.size();
236
+double numberOfHoursToTeachEachStudent = 1200;
237
+double numberOfHoursToTeach = numberOfHoursToTeachEachStudent * numberOfStudents;
238
+double numberOfHoursPerInstructor = numberOfHoursToTeach / numberOfInstructors;
239
+```