Advertisement
daniel_c05

Classes and Constructors.cpp

Feb 18th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. //Classes, constructors, and methods.
  2.  
  3. #include <iostream>
  4. #include <string>
  5. #include "test\test\Banking_Base.h" //location of my header file(http://pastebin.com/2TYRjANf)
  6. using namespace std;
  7.  
  8. int main () {
  9.  
  10. BankAccount My_New_Account("5178517851785178");
  11.  
  12. cout << "Today we are going to create a new Bank Account (Class)!\n"
  13.      << "Let's start by getting the account holder's name. What is your name?\n"
  14.      << endl;
  15.  
  16. string name;
  17. getline(cin, name, '\n');
  18.  
  19. My_New_Account.setCardOwner(name);
  20. cout << "The new account holder's name is ";
  21. My_New_Account.printProperty('o');
  22.  
  23. cout << "What type of card would you like to have? (Visa or Mastercard)" << endl;
  24. string type;
  25. cin >> type;
  26.  
  27. My_New_Account.setCardType(type);
  28. cout << "The new account type is ";
  29. My_New_Account.printProperty('t');
  30.  
  31. cout << "What type of rewards would you like to have? (Cash or Miles)" << endl;
  32. string rewards;
  33. cin >> rewards;
  34.  
  35. My_New_Account.setRewardsType(rewards);
  36. cout << "You chose to have ";
  37. My_New_Account.printProperty('r');
  38.  
  39. cout << "What Credit Limit would you like to have? (Amount should have two decimal places please)" << endl;
  40. double limit;
  41. cin >> limit;
  42.  
  43. My_New_Account.setCreditLimit(limit);
  44. cout << "Your new credit limit is ";
  45. My_New_Account.printProperty('l');
  46. cout << "Your available credit starts at ";
  47. My_New_Account.printProperty('a');
  48. cout << "Your current balance starts at ";
  49. My_New_Account.printProperty('b');
  50.  
  51. cout << "Now that you have a brand new card" << " , let's go ahead and buy something with it!"
  52.      << "Enter the amount of cash you would like to withdraw today. (Use two decimal places please)"
  53.      << endl;
  54.  
  55. double tAmount;
  56. cin >> tAmount;
  57.  
  58. My_New_Account.newAuthorization(tAmount);
  59.  
  60. //My_New_Account.printProperty();
  61.  
  62. cout << "And that concludes today lesson, we'll be adding more properties and methods to this example as time allows us to. (Enter $ to Exit)" << endl;
  63.  
  64. string newStr;
  65. getline(cin, newStr, '$');
  66.  
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement