Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SavingsAccount
- {
- public double balance;
- public double annualInterest;
- public double interestYTD;
- double totalDeposits;
- double totalWithdraws;
- public SavingsAccount(double startingBalance, double interest)
- {
- annualInterest = interest;
- balance = startingBalance;
- }
- public void makeDeposit(double b)
- {
- balance += b;
- totalDeposits += b;
- }
- public void makeWithdraw(double b)
- {
- balance -= b;
- totalWithdraws += b;
- }
- public double getTotalDeposits()
- {
- return totalDeposits;
- }
- public double getTotalWithdraws()
- {
- return totalWithdraws;
- }
- public double getBalance()
- {
- return balance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement