Josif_tepe

Untitled

Jan 20th, 2026
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. // exercise 1
  2. sequenceDiagram
  3. autonumber
  4. actor U as User
  5. participant WS as Web Server
  6. participant SD as Salt Database
  7. participant PD as Password Database
  8.  
  9. U->>WS: Access Web Server
  10. WS->>U: Promt for Username
  11. U->>WS: Provide Username
  12. WS->>U: Prompt for Password
  13. U->>WS: Provide Password
  14.  
  15. WS->>SD: Send Username
  16. SD->>SD: Search for Salt
  17. SD-->>WS: Return Salt
  18.  
  19. WS->>WS: Encrypt provided password using Salt
  20.  
  21. WS->>PD: Send Username
  22. PD->>PD: Search for stored Encrypted Password
  23. PD-->>WS: Return stored Encrypted Password
  24.  
  25. WS->>WS: Compare Encrypted Passwords
  26.  
  27. alt Passwords Match
  28. WS->>U: Display Success Page
  29. else Passwords Do Not Match
  30. WS->>U: Display Failure
  31.  
  32. end
  33.  
  34.  
  35. stateDiagram-v2
  36. [*] --> Idle
  37.  
  38. note right of Idle : Waiting for requests
  39.  
  40.  
  41. Idle --> Searching : Recieve Username
  42. note right of Searching: Database looks up record
  43.  
  44. Searching --> Replying : Salt Found
  45. note right of Replying: Sending data back
  46.  
  47. Replying --> Idle : Salt Sent
  48.  
  49.  
  50. // exercise 2
  51. stateDiagram-v2
  52. [*] --> Idle: Power On
  53.  
  54. state "Idle\n(entry: LED Off)\n(do: Display Time)" as Idle
  55. state "Alarm Setting" as Setting
  56. state "Alarming\n(entry: Start Flash)\n(do: Beep)" as Alarming
  57. state "Snooze\n(do: Display Time)" as Snooze
  58.  
  59.  
  60. Idle --> Setting: press set button
  61. Setting --> Idle: press save button
  62.  
  63. Idle --> Alarming: alarm time reached / Turn LED On
  64.  
  65. Alarming --> Idle: press stop button / Stop Beeping, Stop Flashing
  66.  
  67. Alarming --> Snooze : press snooze button / Stop Flashing
  68.  
  69. Snooze --> Alarming: after 5 mins / Send E-mail
  70.  
  71.  
  72. // exercise 3
  73.  
  74. graph TD
  75. Mobile[Mobile Device]
  76. Web[Web Browser]
  77.  
  78. subgraph "E-Store Application"
  79. Acc[Accounting Function]
  80. Cat[Catalogue Function]
  81. Ord[Ordering Function]
  82. Pri[Pricing Function]
  83. Inv[Inventory Function]
  84. end
  85.  
  86. DB_Acc[(Accounting DB)]
  87. DB_Cat[(Catalogue DB)]
  88. DB_Ord[(Ordering DB)]
  89. DB_Pri[(Pricing DB)]
  90. DB_Inv[(Inventory DB)]
  91.  
  92. Mobile -.-> Acc
  93. Mobile -.-> Cat
  94. Mobile -.-> Ord
  95. Web -.-> Acc
  96. Web -.-> Cat
  97. Web -.-> Ord
  98.  
  99. Ord --> |Output is Input| Pri
  100. Pri --> |Output is Input| Inv
  101.  
  102. Acc --- DB_Acc
  103. Cat --- DB_Cat
  104. Ord --- DB_Ord
  105. Pri --- DB_Pri
  106. Inv --- DB_Inv
  107.  
  108.  
  109.  
Advertisement
Add Comment
Please, Sign In to add comment