{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# MidtermSol - CSC340 Information Systems Analysis and Design...

This preview shows pages 1–3. Sign up to view the full content.

CSC340 Information Systems Analysis and Design page 1/8 Faculty of Arts and Science University of Toronto Midterm Test Department: Computer Science Instructor: John Mylopoulos Date and Time: 6:10pm Monday, March 1, 2004 Conditions: Open book Duration: 50 minutes This test counts for 20% of your final grade Name: (Please underline last name) Student Number: Question Marks 1. ____________/20 2. ____________/30 3._____________/20 4. ____________/30 Total ____________/100

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CSC340 Information Systems Analysis and Design page 2/8 1. [Short Questions; 20 marks total] [Class diagrams] Here is a class diagram that represents employees in an organization, and the projects they work for. Employee Project emp#: Number addr: Address salary: \$Value assign(emp:Employee) (a) [Class diagrams – 4 marks] Specify a constraint in CL that says: “Every employee earns less than his/her manager” Forall y[includes(self.manager.salary, y) implies self.salary < y] (b) [Class diagrams – 6 marks] Specify pre/post-conditions for the operation assign(emp;Employee) in CL that make sure that an employee is not assigned to a project he is currently working for; also if an employee is assigned to a new project and he is already working for at least 3 other projects, then her salary is increased by 10%. pre: not includes(emp.worksFor,self) post: includes(emp.worksFor,self) and [size(emp.worksFor) 4 implies emp.salary = * 1.1 will also accept pre: not includes(emp.worksFor,self) post: size(emp.worksFor) 4 implies emp.salary = * 1.1 worksFor manages manager 0..* 1 0..* 1..*
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}