Question: Python, Class and OOP. Please comment out. In OOP lab5-1 Q2, we created a class named bankBalance with the attribute balance. Suppose the current interest

Python, Class and OOP. Please comment out.

Python, Class and OOP. Please comment out. In OOP lab5-1 Q2, we

In OOP lab5-1 Q2, 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 "calbbalance()" to calculate the finial balance. You may need the following formula for calculation: A=P(1+(nr))nt , 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 0.02 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!