UML Exercise 2 - UniMAP Portal

advertisement
DKT 311 SOFTWARE ENGINEERING
EXERCISE 2
1. ABC Book Store has books, videos, and CDs that it loans to its users. All material
has a id# and a title. In addition, books have one or more authors, videos have one
producer and one or more actors, while CDs have one or more entertainers.
The store maintains one or more copies of each library item (book, video or CD).
Copies of all library material can be loaned to users. All material can be loaned for
2 weeks.
For every loan, the store records the user, the loan date and time, and the return
date and time. For users, the store maintains their name, address and phone
number. Each user has membership card. Credit is updated on the card during rent
operation.
Design a class diagram for the description above. Make sure to show attributes,
multiplicities and aggregations/compositions, where appropriate. No need to show
any methods.
2. The process of electing a candidate for an position at the university is a complex
flow that consists of several steps. The main organization, mainly the department
foresees that additional human resources are needed and files a request to the
academic council. When the academic council approves the position, mainly after
the ministry of higher learning grants additional funding, then the department is
expected to propose a commission. The commission is approved by the academic
council. The position is published in the daily newspapers. The candidates apply.
The commission writes the evaluation report and proposes the best candidate. The
candidate is approved by the department and elected by the academic council. The
use case diagram is presented in Figure 1.
Apply for Position
Academic Staff
University Administration
Figure 1: Apply for Position Use Case
a. Design a sequence diagram for the use case in Figure 1.
b. Design an activity diagram for the use case in Rajah 1.
3. Make a class diagram that captures the following:











A company consists of departments and employees.
A department has responsibility for zero, one or more projects.
A company has: name, address and telephone.
A department has name.
A project has name.
An employee has name, address, a social security number (SSN) and is
participating in zero, one or more projects.
A project has a leader that is an employee.
A company has one or more owners; the system must keep track of the
owners name, address and social security number.
An employee is assigned to zero or more departments.
For each assignment a title (e.g. programmer), salary and extent is defined
(e.g. an employee can work 25% for one department and 75% for another
department, the first assignment has extent 25 and the last 75).
Tax rate is given for each company the employee is working for (the tax
rate applies to all assignments in the same company). An employee
number is also recorded for each company the employee is working for.
4. Draw a state diagram to model the behaviour of a fuel pump controller.




User can buy fuel after inserting a credit card, which is read and validated by
the controller.
Then the user takes the hose out of the holster, and pushes the nozzle trigger,
to fuel his car.
When the nozzle is off, the fuel flow is stopped and the price is charged on the
credit card
If invalid card or timeout the system returns to the initial waiting state.
Download