/* Modular Example */ /* Transaction.cpp */ /* OOP244 */ /* Jan 14 2009 */ #include using namespace std; #include "Transaction.h" // prompts for and accepts Transaction data 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 ; } // displays Transaction data void display( struct Transaction tr ) { cout << "Account " << tr.acct ; cout << ( tr.type == 'd' ? " Debit $" : " Credit $") << tr.amount; cout << endl; }