Advertisement
uopspop

main.c

Apr 13th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. // Exercises 3.12 (p. 131) Class practice
  2. #include <iostream>
  3. #include "account.h"
  4. using namespace std;
  5.  
  6. int main(){
  7. // open two accounts and set the initial balance
  8.     Account Jane(-100000);
  9.     Account Tom(9999);
  10.     cout << "Jane's balance: " << Jane.getBalance() << endl;
  11.     cout << "Tom's balance: " << Tom.getBalance() << endl;
  12. // add balance
  13.     Jane.credit(6666);
  14.     Tom.credit(3334);
  15.     cout << "Jane's balance: " << Jane.getBalance() << endl;
  16.     cout << "Tom's balance: " << Tom.getBalance() << endl;
  17. // withdraw balance
  18.     Jane.debit(9999999);
  19.     Tom.debit(1000);
  20.     cout << "Jane's balance: " << Jane.getBalance() << endl;
  21.     cout << "Tom's balance: " << Tom.getBalance() << endl;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement