UML Diagrams for ATM System

Verified

Added on  2019/09/16

|14
|657
|396
Practical Assignment
AI Summary
This practical assignment focuses on designing an ATM system using Unified Modeling Language (UML) diagrams. The solution provided includes a class diagram illustrating the system's classes (System, RegisteredUserData, MachinePartData, Start, Idle, Ready) and their attributes and methods. A detailed description of each class operation is given, outlining the system's functionality, including user registration, login, price changes, and notifications. The solution also presents sequence diagrams demonstrating the user registration process to observe price changes and the system's notification process for price changes of specific machine parts. The assignment showcases the application of UML in visualizing and specifying the design of a software system.
Document Page
Problme#1
Class diagram
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Document Page
Class operations brief description:
Class System:
S// point to current state
LS[0] // point to start state
LS[1] // point to idle state
LS[2] // point to ready state
Operations:
create(){
S->create()
currState = S.getID()
IF currState == 0 THEN
S = LS[1] //change ATM state from “Start” to “Idle”
ENDIF
}
Class: System
Login(String loginId, String password){
If(currentState == 0) then
If( rud.getLoginId.equals(loginId) && rud.getPassword(password)) then
S = LS[2];
Else
S = LS[1];
End if
End if
Document Page
}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Register(String loginId, String password,String machinePartId){
If(currentState == 0) then
Rud.setLoginId(loginId);
Rud.setPasswrod(password);
Rud.setMachinePartId(machinePartId);
S = LS[1];
End if
}
UnRegister(String loginId){
If(currentState == 2) then
If(rud.getLoginId.equals(loginId)) then
Rud.removeuser();
S = LS[1];
End if
}
changePriceMachinePartId(String machinePartId, double newPrice){
If(currentState == 2) then
if( mpd.getMachinePartId == marhicnePartId) then
mpd.setPrice(newPrice);
end if
end if
}
viewMachinePrice(userLoginId){
Document Page
If(currentState == 2) then
if (rud.getMachineId() && mpd.getMachinePartId()) then
print: mpd.getMachinePartPrice();
end if
end if
}
notifyRegisteredUsers(String machinePartId){
If(currentState == 2) then
loop: getRegisteredUser{
if(user.getMachinePartId == machinePartId) then
user.setNotification(true);
end if
end loop
end if
}
}
Class: RegisteredUserData
getLoginId(){
Document Page
return loginid;
}
setLoginid(String loginIdd){
set logingId = loginidd;
}
setPassword(String pass){
set password = pass;
}
getPassword(){
return password ;
}
getMachinePartId(){
return machinePartId;
}
setMachinePartId(String mPartId){
set machinePartId = mPartId;
}
getanyNotification(){
return nayNotification;
}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
setNotification(Boolean status){
set anyNotification = status;
}
Class: MachinePartData
getMachineName(){
return name;
}
setMachineName(String nm){
set name = nm;
}
getMachinePartId(){
return id;
}
setMachinePartId(String idd){
set id = idd;
}
getmachinePartPrice(){
return price;
}
setmachinePartPrice(double p){
set price = p;
Document Page
}
Class: start
ID = 0;
Create(){
// no action defined
}
Class: “Idle”
Id = 1
Login(String loginId, String password){
Rud.setLoginId(loginId);
Rud.setPassword(password);
}
registerString loginId, String password,String machinePartId){
Rud.setLoginId(loginId);
Rud.setPassword(password);
Rud.setMachinePartId(machinePartId);
}
Document Page
Class Ready:
changeMachienPartPrice(String machineId, double newprice){
loop: machinesPart : mpd
if(mpd.getMachinePartId == machineId) then
mpd.setMachinePartPrice(newprice);
end if
end loop;
}
viewMachinePrice(String loginId){
print: mpd.getMachinePartPrice();
}
notifyRegisteredUsers(String machinePartId){
loop: Registereduser -> rdu
if(rdu.getMachinePartId == machinePartid) then
print: mpd.getMachinePartPrice();
end if
end loop;
}
Exit(){
// exit from the system}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Sequence Diagram:
1. How the user registers to observe a price change of a selected machine
Part
Document Page
Document Page
2. How the system notifies users about price change of a specific machine
Part
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
chevron_up_icon
1 out of 14
circle_padding
hide_on_mobile
zoom_out_icon