Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Chapter 2

UML
Exercise 1
Please draw a use case diagram for class management system.

Use case: login in; get back password; look up class information;
modify class information; insert class information; delete class
information

Users: administrator and dean principal


dean principle

look up class information <<in


clud
e >>
<<inc
lude >
>
delete class information
<<include >> login in get back password
administrator > >
modify class information de
nc lu
< <i

insert class information


Exercise 2
Please draw a use case diagram for student grade system.

Use case: login in; get back password; look up student grade; modify
grade; insert grade; delete grade; save grade

Users: teacher and student


<<include >>

insert grade > save grade


ude>
< i ncl
<

>
e>
lud
inc
modify grade

<<
student
teacher look up grade

delete grade
<<extend >>

login in get back password


Exercise 3
(1)What is the relationship between class Student and class Course?
(2)Can you describe the meaning of this diagram?
(3) Write the java code of this class diagram.
public class Student{
private String name;
private Course[] selecters;
public void Student(){}
public void test(){}
}
Exercise 4
1 Which one is the participant of the
system ?
A① B② C③ D④

2 Which one is the object ?


A① B②③④ C ④
D⑤⑥⑦⑧⑨⑩

3 What operation of class CreditService is


called up by class Server ?
A⑦ B⑧ C ⑦⑧ D⑧⑨
1 指出左图中的参与者?
A① B② C③ D④

2 哪些是对象?
A① B②③④ C ④
D⑤⑥⑦⑧⑨⑩

3 Server 类调用了 CreditService 类中的


什么操作?
A⑦ B⑧ C ⑦⑧ D⑧⑨
1. A 2. B 3. B
going up
At 1st Floor Ascending

Descending to arrived at 1 Floor arrive


st
going up
1st Floor
Descending arrive Idle

going down

time over

(1) which one is the state ?


(a) time over (b) arrive (c) At 1st Floor
(2) If state Idle is time over, which state will the lift transfer to?
 (a) Descending to 1st Floor (b) Ascending (c ) final state
going up
At 1st Floor Ascending

Descending to arrived at 1 Floor arrive


st
going up
1st Floor
Descending arrive Idle

going down

time over
Answer:
(1) which one is the state ? (1) (c)
(2) (a)
(a) time over (b) arrive (c) At 1st Floor
(2) If state Idle is time over, which state will the lift transfer to?
 (a) Descending to 1st Floor (b) Ascending (c) final state

You might also like