2
2
2
1. Draw the class diagrams for the following English statements and Also, show
some of the Operations and Attributes in it
1. A rose is a kind of flower
flower
1.1 generalization
rose
shape
1.4 generalization
circle
1 1
window frame 1.5 composition
Ravi cricket
1.12 association
ravi
1.13 self association
football
RAVI {or}
1.19 association
Cricket
electronic
pencil 2 interface
sharpner
whole
computer
person
login() 3 interface
shutdown() touchpad
diing uses
philospher fork 4.5 association
text
{or}
drawing object geometrical
4.7 association
{or}
group
i/p devices
4.8 generalization
modems keyboards
5. You are interacting with an online travel agent and encounter the following
use cases. Prepare a use case diagram, using the generalization and include
relationships.
Purchase a flight. Reserve a flight and provide payment and address information
Provide payment. Information provide a credit card to pay for the incurred charges
Provide address. Provide mailing and residence addresses
Purchase a hotel stay. Reserve a hotel room and provide payment and address
information
reserveflight
<<include>>
customer
providepayment
providemailingaddress
purchasehotelstay
B a nk
nam e : c har
branc h : char
A TM
A ddres s : c har
S tate : c har
C lie nt
Nam e : c har A cco unt
A c c no : c har ac c ount N o : c har
P in No : num ber balanc e : num ber
ac c Ty pe : c har
withdraw()
depos it() w ithdrew ()
trans fer() c redit()
balenquiry () trans for()
balE nq()
insert ATMcard
choose thelanguage
database
verifythePINnumber
do withdrawor balance
enquieryoperations
if operationis withdraw
check balance
givetransactiondetails
collect receipt
leavefromtheatm
Sequence Diagram:
1: Insert card
2: V alidate account
3: V alid A ccount
4: Request P IN
5: E nter P IN
6: C heck P IN
7: V alid P IN
8: Request for operation
9: S elect op eratio n
10: P roce ss Request
Collaboration Diagram:
1 : In s e rt c a rd
5 : E n te r P IN 2 : V a li d a te a c c o u n t
9 : S e le c t o p e ra ti o n 6 : C h e c k P IN
1 0 : P ro c e s s R e q u e s t
4 : R e q u e s t P IN 3 : V a li d A c c o u n t
8 : R e q u e s t fo r o p e ra tio n 7 : V a li d P IN
1 2 : R e le a s e a m o u n t/p ri n td e1ta1 i:lsR e tu rn p ro c e s s re s u lt
C u s to m
er D a ta B a s
e
Activity Diagram:
Enter PIN
Valid
Yes
CheckMinBal
Need Print
ance
BalanceAvailabla
Yes
No
Take Cash
Print Slip
Print slip
M
M Display
Details
ACTIVITY-DIAGRAM
Deployment Diagram:
Requests/Services
Atm system
Information
BankDatabase
Maintainence
Bank
Program7:
Class Diagram:
E s e a va O ffi c e
lo c a t io n : s t rin g
b ra n c h : s t rin g
b ra n c h c o d e : n u m b e r
n o o fe m p loy e e s ()
C lie nt
n a m e : S trin g E s e va E m p lo ye e
a d d re s s : s t ring n a m e : S trin g
p h o n en o : n um b e r d is ign a t io n : s t ring
s a la ry : d o u ble
s e le c tla n gu a g e ()
p a y b ill() p ro c e s s c lie n t s re q ()
c o llec t re c ip t ()
E s e va W e b c o llec t m o n e y ()
e n q u iry a b o u tt ra n s a c tion () m a in ta in log ()
res e rve t ic k e t() m a in ta in t im e t a b le s ()
c o llec t tic k e t ()
res e rve t ic k e ts ()
c a n c eltic k e t s ()
m a in ta in t im e t a b le s ()
S e le c tT yp e O fB ill
P a yB ills
E s e va c le a rk
B ille r
P ro c e s s R e q ue s t
M a inta inTim e T a b le s
C o lle c tR e c e ip t
P ro c e s s R e q ue s t
C o lle c tT ic k e t
Sequence Diagram:
1: MaintainDataBase
2: SelectLanguage
3: DisplayInSelectedLang
4: SelectBillType
5: VerifyBillDetails
8: Pay Money
12: CollectPaySlip
13: EnquireReservation
14: CheckAvailability
15: ReturnAvailability
16: DisplayAvailability
17: PayMoney
18: ProcessRequest
19: PrintTicket
20: CollectTicket
Collaboration Diagram:
E _ C e nte
r
2 : S e le c tL a ng ua g e
4 : S e le c tB illTyp e
8 : P a y M o ne y
1 3 : E nq uire R e s e rva tio n 5 : V e rifyB illD e ta ils
1 7 : P a yM o ne y 1 0 : U p d a te D a ta B a s e
1 4 : C he c k A va i la b ility
1 2 : C o lle c tP a yS lip3 : D is p la yInS e le c te d L a ng 6 : R e turn B ill D e ta ils
2 0 : C o lle c tTic k e t 7 : D is p la y B ill a m o unt 1 5 : R e turnA va ila b ili ty
1 1 : P rintD e ta ils
1 6 : D is p la yA va ila b ility 1 : M a inta i nD a ta B a s e
1 9 : P rintT ic k e t
C us to m
er
ESEVA
Activity Diagram:
S elect
C heckB illD et
Language
ails
S elect Type
of B ill
C olle ct
Pa y M oney
A m ount
E nquireRes P rocessReq
ervation uest
Pa y M oney
Up dateD ata
B a se
C olle ct
receip t/Ticket
Deployment Diagram:
ServicesInformation
E seva _DB
RailwayInformation
Ra ilway_D B
Pragram8:
Bapatla Engineering College, Bapatla
21
Safe Home
Problem Statement:
The home security system that would protect against and/or recognize a variety of
undesirable situations such as illegal entry, fire, flooding and others. The product, will
use appropriate sensors to detect each situation can be programmed by the home owner,
and will automatically telephone a monitoring agency when a situation is detected.
The main concern in systems development has been the integration of
technologies to increase customer satisfaction; the most recent being the integration of
wireless devices and home appliances. SHACS is one such system which aims at
accomplishing this. It is a system which is controlled by wireless devices like cell phones,
PDAs, palm tops etc. and in turn controls home appliances like ovens, water sprinklers,
air conditioner, doors, home alarm system, etc.
Users use SHACS to control their home appliances by using their wireless
devices. It is an adaptable system too; it detects changes in environment and acts
accordingly. It should be flexible enough to allow addition or removal of devices to
control its functioning, and also the appliances it controls. Also it should be capable
enough to add new users or remove obsolete ones.
Class Diagram:
g e t s i g n a l s fr o m s h a c s ( )
fi n d c u s t o m e r a d d r e s s ( )
t a k in g a p p r o p r ia t e d e c is io n s ( )
p ro v id e s e r vic e ( )
S a fe h o m e s y s te m
n a m e : s t rin g
S a fe H o m e s y s te m c u s to m e r
m a n u fa c t u r e r : s t r i n g
n a m e : s t rin g h e lp lin e n o s : s t r in g
a d d re s s : s trin g
c u s tid : n u m b e r m o n it o rd e v ic e s ()
m o n ito rs e n s o rs ()
m o n it o rd e v ic e s () in fo rm a u t h o r it ie s ( )
m o n ito rs h a c s () c h e c k a c c id e n t s ()
P ri m a ryA la r m S e n s o rs C o n tro lM a n a g e m e n t
In fo rm O wn e r
H o m e O w ne r M a in ta i n U s e rs
S a fe H o m e A p p
li a n c e s
< < in c lu d e > >
In fo rm A g e n c y
Sequence Diagram:
1 : D e v ic e M a n a g e m e n t
2 : A d d D e vi c e
3 : C o n tro lD e v i c e s
4 : D e te c tA c c i d e n ts
5 : A p p ly P ri m a ry A c tio n s
6 : In fo rm O w n e r
7 : In fo rm M o n i to r i n g A g e n c y
8 : P e rfo rm R e la tiv e A c ti o n
9 : P e rfo rm R e la tive A c ti o n
Collaboration Diagram:
Bapatla Engineering College, Bapatla
25
3 : C o n tr o lD e v i c e s
4 : D e te c tA c c i d e n ts
5 : A p p ly P r im a r y A c tio n s
S a fe H o m e S
y s te m
2 : A d d D e vic e
9 : P e rfo rm R e la ti v e A c ti o n 7 : In fo r m M o n i to r in g A g e n c y
8 : P e rfo rm R e la ti v e A c tio n
1 : D e v ic e M a n a g6 e: mIn fo
e nr m
t O w ne r
M o n ito ri n g A
C u s to m g e ncy
er
Activity Diagram:
Inform Monitoring
MonitoringAgency Agency
ProvideServi
ce
Deployment Diagram:
SHAC S
M a inta na nc e
S e rvic e s
M o nito ring A g e nc y
Program9:
Bapatla Engineering College, Bapatla
28
Safe Railways
Problem Statement:
A Safe railway system is a system that should not cause any accidents to the trains
because these accidents may cause due to railway signaling, brake control, level-crossing,
fire accidents, scheduling of trains on a single track.
Railway signaling is a system used on railways to control traffic safely that is to prevent
trains from colliding. If there is a delay in signaling, it may result in collision. To prevent
this block signaling is used which uses a computer to calculate a safe zone, behind each
moving train, which no other train may enter depends on precise knowledge of where
each train is and how fast it is moving.
For brake control, an automatic train stop device is used which automatically activates an
emergency brake to stop a train when the operator does not correctly response to a stop
signal.
Class Diagram:
m o n it o r S t a t io n s ()
r e s p o n d t o P r o b le m s ()
a c t iva t rS R S ()
R a i lw a y E m p lo y e e
n a m e : s tr i n g
e m p N o : num b e r
d e s i g n a ti o n : s tr i n g
tra i n N o : n u m b e r
p ho ne N o : num b e r S A F E R A IL W A Y S
m a n u fa c t u re r : s t rin g
r e c e i v e S i g n a ls ( ) T ra i n N o s : n u m b e r
a p p ly L e v e lC r o s s in g ()
a p p ly B r e a k s ( ) r e c e i ve S ig n a l ()
m o n ito r T r a c k s () a c t i va t e S R S ( )
m o n ito r T r a i n A rr iv a ls ()
c le a rT ra c k s ( )
g i v e S i g n a ls ( )
r e -b u ild S i g n a ls ( )
fi n d P ro b le m s ()
i n fo r m S R S ()
Signal Failure
Activate SRS
Fire Accidents
Apply Breaks
Level-Cros sing
Activate SRS
Sequence Diagram:
1 : P ro b le m O c c ure d
2 : D e te c tP ro b le m
3 : Id e ntifyP ro b le m
5 : N o tS o lve d
6 : Info rm P ro b le m
7 : T a k e P rim a ryA c ti o ns
8 : N o tS o lve d
9 : A c tiva te S R S
1 0 : S to p T ra in
Collaboration Diagram:
1 : P ro b le m O c c u r e d
5 : N o tS o lve d
T r a in
R a ilw a yE m p l
o ye e
4 : A p p lyP ri m a r yA c tio n s
8 : N o tS o lv e d
6 : In fo r m P ro b le m
7 : T a k e P rim a ryA c ti o n s
1 0 : S to p T ra i n
R a ilw a y s A u
th o ri ty
SRS 9 : A c ti va te S R S
Activity Diagram:
Lineman/Driv
er RailwayAuth
ority
DetectProblem
s
RebuildSign
al
TakePrimary
Actions
ActivateSRS
InformAuthori
ty
Deployment Diagram:
P ro b le m s /R e q ue s ts
SRS
Pragram10:
H o s p ita l S ys te m
P a tie n t Nam e
Name N o . o f D o c to rs
A d d re s s + R e g is te r N o . o f P a tie n ts
Age
F a c i li ti e s ()
V e ri fy D e ta ils () D o c to rs ()
R e g is te r() R e g is tra ti o n ()
B i llin g ()
+ T re a ts
D o c to rs + C o ll e c ts In fo
Na m e
S p e c ia liza tio n
P a ti e n t D e ta i ls ()
T re a tm e n t()
R e g is te ri n g
R e c e p ti o n is t
P a tie n ts
F a c i li ti e s A va ila b le
D o c to rs In fo rm a ti o n D o c to r
P a tie n ts In fo rm a ti o n
P e rs o n a l
1: Facilities Info
Facilities
Available 2: Display Facilities
3: Doctors Info
Doctor 4: Display Doctors Details
Details
5: Perform Registration
8: Process
11: Process
16: Process
17: Response
19: Process
21: Connecting
Report
Generation
22: Enter Authorisation
23: Entering
24: Process
25: Done
27: Process
8 : P ro ce ss
11 : P roc e s s
1 : F a cilitie s Info 16 : P roc e s s
3 : D o cto rs Info 19 : P roc e s s
P a tie nt 5 : P erform R e g istra tio n 24 : P roc e s s
7: E nte ring D e ta ils 27 : P roc e s s
10 : E ntering D e ta ils
2: D is pla y F a c ilitie s
4 : D is pla y D oc to rs D e tails S yste m
6 : E nter P e rs o na l D e ta ils
9 : E nte r H e alth D e ta ils
1 2 : Tha nk You
22 : E nte r A utho risa tio n
25 : D o ne
2 8 : D is pla y D a y's O p e ra tio ns
1 3 : C onne ct
1 5 : E nte ring
1 8 : G ive P a tie nt D e ta ils
D o ctors
A utho riti
es
Enter
Hospital
Get
Registered
See for
facilities
Contact
doctor
Get cured of
disease
Ask for
subscription
Pay the
amount
Deployment Diagram:
Bapatla Engineering College, Bapatla
41
P a tient
C uring
D octor Ho spit
Looks al
M anages
Report
A uthori Genera tes
ty
Program11:
Class Diagram:
C e llU s e r
Nam e
A d d re s s s
P ro o f
R e c e i v e A C a ll
C u s to m e r
G ro u p C a ll
N e tw o rk
W a k e U p C a ll
Sequence Diagram:
4: Response
9: P rocess
10: Response
20: Process
21: Response
22: Response
Collaboration Diagram:
4 : R e sp onse
5 : S ched ule the C a lls
10 : R e sp o nse
1 1 : S che d ule the C a lls
16 : R e sp o nse
21 : R e sp o nse
Ne two rk
Activity Diagram:
Deployment Diagram:
Services
C ell
se...
Network
Networ
...
Maintaining database
Updati
on...
Pragram12:
Class Diagram:
D a ta B a s e M G
N o .O f B o o k s
C o s t O f B o o+k Ms a na g e s
E d i t io n o f B o o k s
U p d a tio n ()
S e le c ting B o o k s
S ite M a na g e r
C us to m e r < < e x te n d > >
P a y the A m o unt
Thro ug h O nL ine
Thro ug h M .O .
D a ta B a s e S ys te m s
Ne w B ooks
Sequence Diagram:
3: Display List
4: Retrieve Index Page
8: Enter Information
10: Done
Pay the
Amount 12: Process
Collaboration Diagram:
S ys te m
2 : A s k fo r O p tio n
5 : D is p la ys The L is t
7 : E nte r B o o k D e ta ils
1 0 : D o ne
1 3 : S ho w The A m o unt
1 5 : B o o k Is s ue d
S ite
M a na g e r
Activity Diagram:
See list of
books
Selecting
books
Pay amount
MO Through
Online
Pay Paying
Get registered if
needed
Deployment Diagram:
Browse Books
Online
Bo...
Site
M...
Updating
Datab
ase