/* Modular Example */ /* Transaction.cpp */ /* OOP244 */ /* Jan 14 2009 */ #include using namespace std; #include "transaction.h" void enter(struct Transaction* tr ) { cout << "Enter the account number : "; cin >> (*tr).acct ; cout << "Enter the account type (d for debit, c for credit) : "; cin >> (*tr).type ; cout << "Enter the account amount : "; cin >> (*tr).amount ; } void display(struct Transaction tr ) { cout << "Account " << tr.acct ; cout << (( tr.type == 'd') ? " Debit $" : " Credit $") << tr.amount ; cout << endl; }