Advertisement
Bomixius

Untitled

Nov 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public class SavingsAccount
  2. {
  3. public double balance;
  4. public double annualInterest;
  5. public double interestYTD;
  6. double totalDeposits;
  7. double totalWithdraws;
  8.  
  9.  
  10. public SavingsAccount(double startingBalance, double interest)
  11. {
  12. annualInterest = interest;
  13. balance = startingBalance;
  14. }
  15.  
  16. public void makeDeposit(double b)
  17. {
  18. balance += b;
  19. totalDeposits += b;
  20. }
  21. public void makeWithdraw(double b)
  22. {
  23. balance -= b;
  24. totalWithdraws += b;
  25. }
  26.  
  27. public double getTotalDeposits()
  28. {
  29. return totalDeposits;
  30. }
  31. public double getTotalWithdraws()
  32. {
  33. return totalWithdraws;
  34. }
  35.  
  36. public double getBalance()
  37. {
  38. return balance;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement