Storyboard StudyRightWithAssignmentsStoryboard

1. (start situation/pre-condition) Karli enters the Study-Right University in the math room. Karli has no credits yet and still a motivation of 214.

      University university = new University()

      Student karli = university.createStudents()

      Assignment matrixMult = new Assignment()
         .withContent("Matrix Multiplication")

      Assignment series = new Assignment()

      Assignment a3 = new Assignment()

      Room mathRoom = university.createRooms()
         .withAssignments(matrixMult, series, a3);

      Room artsRoom = university.createRooms()

      Room sportsRoom = university.createRooms()
         .withDoors(mathRoom, artsRoom);

      Room examRoom = university.createRooms()
         .withName("The End")
         .withDoors(sportsRoom, artsRoom);

      Room softwareEngineering = university.createRooms()
         .withTopic("Software Engineering")
         .withDoors(artsRoom, examRoom);

2. Karli does assignment a1 on Matrix Multiplication and earns 5 points
(general rule: the student earns always full points for doing an assignment).
Karli's motivation is reduced by 5 points to now 209.

      karli.setAssignmentPoints(karli.getAssignmentPoints() + matrixMult.getPoints());

3. Karli does assignment a2 on Series and earns another 6 points.
Thus Karli has 11 points now. Motivation is reduced to 203.

      karli.setAssignmentPoints(karli.getAssignmentPoints() + series.getPoints());

4. Karli does the third assignment on Integrals, earns
another 8 points and thus Karli has now 19 points and a motivation of 195.

      karli.setAssignmentPoints(karli.getAssignmentPoints() + a3.getPoints());

5. Since 19 points are more than the 17 points required for the 17 math credits, Karli hands the points in and earns the credits and has his assignmnet points reset to 0.
(General rule: if the points earned by the assignments are higher or equal than the credit points, the credit points will be awarded to the student.)

      if (karli.getAssignmentPoints() >= mathRoom.getCredits())
         karli.setCredits(karli.getCredits() + mathRoom.getCredits());

6. (end situation/post-condition) Karli has completed the math topic and moves to sports.

Check: Karli's credits: 17 actual 17

Check: Karli's assignment points: 0 actual 0

Check: Number of students: 1 actual 1