Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "SavingAccount.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int dollars;
- int cents;
- string input;
- string input2;
- SavingAccount bank1;
- cout << "Please input initial dollars: ";
- cin >> dollars;
- cout << endl << "Please input initial cents: ";
- cin >> cents;
- bank1.deposit(dollars, cents);
- while (true)
- {
- cout << endl << "Would you like to make a deposit? (Y/N): ";
- cin >> input;
- if (input == "N")
- {
- break;
- }
- cout << endl << "Please input the dollars to be deposited: ";
- cin >> dollars;
- cout << endl << "Please input the cents to be deposited: ";
- cin >> cents;
- bank1.deposit(dollars, cents);
- }
- while (true)
- {
- cout << endl << "Would you like to make a withdrawl? (Y/N): ";
- cin >> input2;
- if (input2 == "N")
- {
- break;
- }
- cout << endl << "Please input the dollars to be withdrawn: ";
- cin >> dollars;
- cout << endl << "Please input the cents to be withdrawn: ";
- cin >> cents;
- bank1.withdraw(dollars, cents);
- }
- bank1.printBalance();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment