Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python: Object Oriented Programming Can I please get code for the following In OOP lab1 Q3, we created a class named bankBalance with the attribute
Python: Object Oriented Programming
Can I please get code for the following
In OOP lab1 Q3, we created a class named "bankBalance" with the attribute "balance". Suppose the current interest rate is 2%. To attract more deposits, the bank decides to raise the interest rate. Create a method called "raise_rate()" in this class to set up a new interest rate for both accounts. Create two accounts with deposits of $1000 or $2000, respectively. Apply the method "raise-rate()" to set a new interest rate to 5%. Create another method called "cal_balance()" to calculate the finial balance. You may need the following formula for calculation A P) , in which: A- Final account balance P- Principle, the initial balance r- Annual interest rate n 12 month t-years over which the interest is accumulating Create a method called "display()" to print out the finial balance. After applying rising interest rate, print the new balance again The final balance for BankAccount "Jon Snow" with initial balance of $1000 at the interest rate of 0.02 after 2 years is: $1040 The final balance for BankAccount "Sansa Stark" with initial balance of $2000 at the interest rate of 8.82 after 3 years is: $2123 The final balance for BankAccount "Jon Snow" with initial balance of $1000 at the interest rate of 0.05 after 2 years is: $1104 The final balance for BankAccount "Sansa Stark" with initial balance of $2000 at the interest rate of 0.05 after 3 years is: $2322 Hint: based on the program in labl, you need more attributes to instantiate the classStep 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