jamesrdaza

Untitled

Oct 7th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "SavingAccount.h"
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int dollars;
  11. int cents;
  12. string input;
  13. string input2;
  14. SavingAccount bank1;
  15.  
  16. cout << "Please input initial dollars: ";
  17. cin >> dollars;
  18. cout << endl << "Please input initial cents: ";
  19. cin >> cents;
  20. bank1.deposit(dollars, cents);
  21.  
  22. while (true)
  23. {
  24. cout << endl << "Would you like to make a deposit? (Y/N): ";
  25. cin >> input;
  26.  
  27. if (input == "N")
  28. {
  29. break;
  30. }
  31.  
  32. cout << endl << "Please input the dollars to be deposited: ";
  33. cin >> dollars;
  34. cout << endl << "Please input the cents to be deposited: ";
  35. cin >> cents;
  36.  
  37. bank1.deposit(dollars, cents);
  38.  
  39.  
  40. }
  41.  
  42. while (true)
  43. {
  44. cout << endl << "Would you like to make a withdrawl? (Y/N): ";
  45. cin >> input2;
  46. if (input2 == "N")
  47. {
  48. break;
  49. }
  50.  
  51. cout << endl << "Please input the dollars to be withdrawn: ";
  52. cin >> dollars;
  53. cout << endl << "Please input the cents to be withdrawn: ";
  54. cin >> cents;
  55. bank1.withdraw(dollars, cents);
  56. }
  57.  
  58. bank1.printBalance();
  59. system("pause");
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment