Question & Answer: Express the following constraints using OCL, with respect to the model. a) A Course should have no prerequisites that are higher level cours…..

Final Exam, pag 5. Express the following constraints using OCL, with respect to the model Pofess ar Geda -grade in (ordered V. canTeach Student Course average double Sect ion -level int nroled -year int -sem eder int UndergradStudent CradStudent a) [1 point] A Course should have no prerequisites that are higher level courses. b) [1 pointj All instructors for a Section must be able to teach (canTeach) the Course

Express the following constraints using OCL, with respect to the model. a) A Course should have no prerequisites that are higher level courses. ____________ b) All instructors for a Section must be able to teach (canTeach) the Course. ____________

Expert Answer

 

5.

a) [2 points] A Course should have no prerequisites that are higher level courses.

context: Course inv: prerequisite->forAll(c | c.level <= self.level)

b) [2 points] All instructors for a Section must be able to teach (canTeach) the Course.

context: Section inv: instructor->forAll(p | p.canTeach->includes(self.Course))

Let me know if you are satisfied with this

Still stressed from student homework?
Get quality assistance from academic writers!