Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Exercises 3.12 (p. 131) Class practice
- #include <iostream>
- #include "account.h"
- using namespace std;
- int main(){
- // open two accounts and set the initial balance
- Account Jane(-100000);
- Account Tom(9999);
- cout << "Jane's balance: " << Jane.getBalance() << endl;
- cout << "Tom's balance: " << Tom.getBalance() << endl;
- // add balance
- Jane.credit(6666);
- Tom.credit(3334);
- cout << "Jane's balance: " << Jane.getBalance() << endl;
- cout << "Tom's balance: " << Tom.getBalance() << endl;
- // withdraw balance
- Jane.debit(9999999);
- Tom.debit(1000);
- cout << "Jane's balance: " << Jane.getBalance() << endl;
- cout << "Tom's balance: " << Tom.getBalance() << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement