fork download
  1. #include <string>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. class bankBranch
  6. {
  7. public:
  8. /** bankBranch(const int& bsbNumber, const string& address, const int& postCode)
  9. {
  10.   this->bsbNumber = bsbNumber;
  11.   this->address = address;
  12.   this->postCode = postCode;
  13. }; **/
  14.  
  15. bankBranch(int, string, int);
  16. void setPostCode()
  17. {
  18. cout << "Please type in the postal code of your bankBranch: " << endl;
  19. cin >> postCode;
  20. }
  21. void setBsbNumber()
  22. {
  23. cout << "Please type in the BSB Number of your bankBranch: " << endl;
  24. cin >> bsbNumber;
  25.  
  26. }
  27. void setAddress()
  28. {
  29. cout << "Please type in the address of your bankBranch " << endl;
  30. cin >> address;
  31. }
  32. // Return methods for bsb number, address and post code
  33. int getBsbNumber()
  34. {
  35. return this->bsbNumber;
  36. }
  37. string getAddress()
  38. {
  39. return this->address;
  40. }
  41. int getPostCode()
  42. {
  43. return this->postCode;
  44. }
  45. private:
  46. int bsbNumber;
  47. string address;
  48. int postCode;
  49. };
  50. bankBranch::bankBranch(int bsbnum, string bankaddress, int bankpostcode) {
  51.  
  52. bsbNumber = bsbnum;
  53. address = bankaddress;
  54. postCode = bankpostcode;
  55.  
  56. }
  57.  
  58. class bankAccount
  59. {
  60. public:
  61. bankAccount(int, int, int, string, int);
  62. private:
  63. bankBranch homeBranch;
  64. };
  65.  
  66. bankAccount::bankAccount(int accountNumber, int accountBalance, int homebsbnumber,
  67. string homeaddress, int homepostcode) : homeBranch(homebsbnumber, homeaddress, homepostcode) {}
  68.  
  69.  
  70. int main()
  71. {
  72. return 0;
  73. }
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty