Evaluating select and sum on a playlist

In a UML model, a Playlist object is linked through the role tracks to five Track objects whose duration attribute values, in seconds, are 210, 185, 342, 128 and 275. With self bound to that playlist, evaluate the OCL expression self.tracks->select(t | t.duration > 200).duration->sum(). Give your answer in seconds as a whole number.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Object Constraint Language (OCL) Questions: