Question
Python Program (Inheritance) Design a SavingAccount class data attributes: account_num, interest_rate, and balance attributes : account_num, interest_rate, and balance methods : get_account_num, check_balance, apply_interest, deposit,
Python Program (Inheritance)
Design a SavingAccount class data attributes: account_num, interest_rate, and balance
attributes: account_num, interest_rate, and balance
methods: get_account_num, check_balance, apply_interest, deposit, and withdraw
Design a CDAccount as a subclass of the SavingAccount class
new attributes: mini_balance
new methods: withdraw (this method should ensure the mini_balance in the account, otherwise displays "insufficient balance")
In the main() function, create an object of SavingAccount and perform deposit, apply interest, and withdraw operations; then create an object of CDAccount and perform the same series of operations.
A sample output of this program is given as follows.
Enter information for a saving account: Account Number: 123 Interest Rate: 0.01 Initial Balance: 1200 Deposit Amount: 600 Account 123 Balance: $ 1800.0 Applying Interest Account 123 Balance: $ 1818.0 Withdraw Amount: 800 Account 123 Balance: $ 1018.0
Enter information for a CD account: Account Number: 321 Interest Rate: 0.03 Initial Balance: 2500 Minimum Balance: 2000 Deposit Amount: 600 Account2 Balance: $ 3300.0 Applying Interest Account 321 Balance: $ 3399.0 Withdraw Amount: 800 Account 321 Balance: $ 2599.0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started