Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Please create a UML Diagram of the PUML script below: - @startuml namespace BankingApp { abstract class Transaction { - decimal _ amount - bool

Please create a UML Diagram of the PUML script below:-
@startuml
namespace BankingApp {
abstract class Transaction {
- decimal _amount
- bool _success
- bool _executed
- bool _reversed
- DateTime _dateStamp
+ decimal Amount
+ bool Success
+ bool Executed
+ bool Reversed
+ DateTime DateStamp
+ Transaction(decimal amount)
+ abstract void Execute()
+ protected void MarkExecuted()
+ protected void MarkReversed()
+ public virtual void Rollback()
+ public virtual void Print()
}
class DepositTransaction {
- Account _account
+ DepositTransaction(Account account, decimal amount)
+ override void Execute()
}
class WithdrawTransaction {
- Account _account
+ WithdrawTransaction(Account account, decimal amount)
+ override void Execute()
}
class TransferTransaction {
- Account _fromAccount
- Account _toAccount
+ TransferTransaction(Account fromAccount, Account toAccount, decimal amount)
+ override void Execute()
+ override void Rollback()
+ override void Print()
}
class BankSystem {
- static Bank _bank
+ Main(string[] args)
+ static void DoDeposit()
+ static void DoWithdraw()
+ static void DoAddAccount()
+ static void DoTransfer()
+ static void DoPrint()
+ static void DoRollback()
}
class Bank {
- List _accounts
- List _transactions
+ Bank()
+ List Accounts
+ List Transactions
+ void AddAccount(Account account)
+ Account GetAccount(string name)
+ void ExecuteTransaction(Transaction transaction)
+ void RollbackTransaction(Transaction transaction)
+ void PrintTransactionHistory()
}
class Account {
- decimal _balance
- string _name
+ Account(string name, decimal balance)
+ bool Deposit(decimal amount)
+ bool Withdraw(decimal amount)
+ void Print()
+ string Name
}
}
Transaction -- DepositTransaction
Transaction -- WithdrawTransaction
Transaction -- TransferTransaction
BankSystem -- Bank
Bank -- Account
@enduml

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions