fork download
  1. //account.cpp
  2. #include "account.h"
  3.  
  4. //Initializing account entities
  5. Account::Account(char fn[], char ln[], char sin[], double bal, int actype, int trans)
  6. {
  7. strcpy(firstName, fn);
  8. strcpy(lastName, ln);
  9. strcpy(sinNumber, sin);
  10. balance = bal;
  11. accountType = actype;
  12. transactions = 0;
  13. };
  14.  
  15.  
  16. //Choose the account
  17. string Account::getAccountType()
  18. {
  19. if (accountType == 1)
  20. {
  21. return "Account Type: Chequing";
  22. }
  23. else
  24. {
  25. return "Account Type: Savings";
  26. }
  27. };
  28.  
  29. //Despoit amount to account of user, will return the balance now
  30. double Account::DepositAmt(double amount)
  31. {
  32. if (amount < 0)
  33. {
  34. cout << "You cannot deposit a negative balance!" << endl;
  35. return -1;
  36. }
  37.  
  38. //the initial balance will be added to the amount deposited
  39. balance = balance + amount;
  40.  
  41. return balance;
  42.  
  43. };
  44.  
  45. //Withdrawal amount from account of user
  46. double Account::WithdrawAmt(double withdrawal)
  47. {
  48.  
  49. //Withdraw more than balance, cause error
  50. if (withdrawal > balance)
  51. {
  52.  
  53. cout << "Sorry the withdrawal amount exceeds the account balance" <<endl;
  54. return balance;
  55. }
  56.  
  57. //withdrawal will deduct from the current balance.
  58. balance = balance - withdrawal;
  59.  
  60. return balance;
  61.  
  62. };
  63.  
  64.  
  65. //Get final balance after withdrawal
  66. double Account::getFinalBalance(double fbal)
  67. {
  68. //this will return the remaining amount
  69. return balance;
  70. };
  71.  
  72.  
  73.  
  74. //Print remaining balance
  75. void Account::PrintStatement()
  76. {
  77.  
  78. cout << "First Name: " << firstName << endl;
  79. cout << "Last Name: " << lastName << endl;
  80. cout << "SIN Number: " << sinNumber << endl;
  81. cout << "Account Type: " << accountType << endl;
  82. cout << "Final Balance: " << balance << endl;
  83. cout << "Transactions: " << transactions << endl;
  84.  
  85.  
  86. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:21: fatal error: account.h: No such file or directory
 #include "account.h"
                     ^
compilation terminated.
stdout
Standard output is empty