Can someone please conver the following code into a sequence diagram for me? the 4 instances and classes with the life lines are: theUI:UserInterface
, theCashPoint:CashPoint
, theActiveAccount:BankAccount
and transactions:TransactionList
void CashPoint::m4_produceStatementForBankAccount() const {
string statement( p_theActiveAccount_->prepareFormattedStatement());
theUI_.showStatementOnScreen( statement);
}
string BankAccount::prepareFormattedStatement() const {
ostringstream os;
//account details
os << prepareFormattedAccountDetails();
//list of transactions (or message if empty)
if ( ! transactions_.isEmpty())
os << "\n\nLIST OF TRANSACTIONS \n" << transactions_.toFormattedString(); //one per line
else
os << "\n\nNO TRANSACTIONS IN BANK ACCOUNT!";
return ( os.str());
}