Respuesta :
Using the knowledge in computational language in python it is possible to write a code that just please add coding for insufficient balance on what I've done.
Writting the code:
class SavingAccount(object):
def __init__(self, account_num,interest_rate,balance):
self.account_num = account_num
self.interest_rate=interest_rate
self.balance=balance
def get_account_num(self):
return self.account_num
def check_balance(self):
return self.balance
def apply_interest(self,interest):
print("Applying Interest")
self.balance = int(self.balance)+(float(interest)*int(self.balance))
def deposit(self,depositamount):
self.balance=int(self.balance)+float(depositamount);
def withdraw(self):
withdrawamount=input("Withdraw Amount: ")
if float(withdrawamount)<float(self.balance):
self.balance=float(self.balance)-float(withdrawamount)
else:
print("insufficient balance")
class CDAccount(SavingAccount):
def __init__(self,account_num,interest_rate,balance,mini_balance):
SavingAccount.__init__(self,account_num,interest_rate,balance)
self.mini_balance=mini_balance
def withdraw(self):
withdrawamount=input("Withdraw Amount: ")
if float(self.balance)-float(withdrawamount)<0:
print("insufficient balance")
return None
self.balance=float(self.balance)-float(withdrawamount)
print("Enter information for a saving account:")
accountnumber=input("Account Number: ")
interest=input("Interest Rate: ")
balance=input("Initial Balance: ")
depositamount=input("Deposit Amount: ")
account = SavingAccount(accountnumber,interest,balance)
print("Enter information for a CD account:")
accountnumber=input("Account Number: ")
interest=input("Interest Rate: ")
balance=input("Initial Balance: ")
mini_balance=input("Minimum Balance: ")
depositamount=input("Deposit Amount: ")
See more about python at brainly.com/question/18502436
#SPJ1
