Consider the following Account class and main function: class Account: acct num-
ID: 3911820 • Letter: C
Question
Consider the following Account class and main function: class Account: acct num-1880 #constructor for Account class (default values for balance #and annual interest rate are 188 and respectively). #INITIALIZER METHOD HEADER GOES HERE #MISSING CODE def getId (self) return self. id def getBalance(self): #HISSING CODE def getAnnualInterestRate(self) return self. annualInterestRate def setBalance (self, balance): self. balance-balance def setAnnualInterestRate(self,rate): #MISSING CODE def getMonthlyInterestRate (self): return self. annualInterestRate/12/18e def getMonthlyInterest (self): #MISSING CODE def withdraw(self, amount): #MISSING CODE def deposit(self, amount): #MISSING CODE def main): aAccount (5889,4.5) a.withdraw (588) a.deposit (1888) print( IDa.getIdO) print(Balance a.getBalance)) print("Monthly interest rate,a.getMonthlyInterestRate)) print("Monthly interest amt -",a.getMonthlyInterest)) print("Annual interest amt-"a.getAnnualInterestRate)) main)Explanation / Answer
question 1:-
There is nothing wrong with the code
question 2:-
it is incorrectly named and thus it won't be executed when new Account objects are created
question 3:-
return self.__balance * self.getMonthlyInterestRate() / 100
question 4 :-
self.__balance -=amount
question 5 :-
an instance variable that is intended to be private
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.