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());
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

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());
} 

end quote.

You might want to see your other post where you copy/paste homework questions for my answer.

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.