Build a class called BankAccount that manages checking and savings accounts
Build a class called BankAccount that manages checking and savings accounts.
Attributes:
customer name,
the customer's savings account balance,
and the customer's checking account balance.
Constructor with parameters (self, new_name, checking_balance, savings_balance)
deposit_checking(self, amount) - add parameter amount to the checking account balance (only if positive)
deposit_savings(self, amount) - add parameter amount to the savings account balance (only if positive)
withdraw_checking(self, amount) - subtract parameter amount from the checking account balance (only if positive)
withdraw_savings(self, amount) - subtract parameter amount from the savings account balance (only if positive)
transfer_to_savings(self, amount) - subtract parameter amount from the checking account balance and add to the savings account balance
(only if positive)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images