Question: Write a class Bank with two methods simple _ interest and compound _ interest. The class has three instance variables: principal, years, and rate (

Write a class Bank with two methods simple_interest and compound_interest. The class has
three instance variables: principal, years, and rate (in percentage). Write a constructor that
initializes these three parameters. The methods return interest using the following formulae:
Simple Interest = Principal * Years *(Rate/100)
Compound Interest = Principal *(1+(Rate/100))Years
Create an instance of the class and invoke both methods. Accept principal, years, and rate from
user.

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 Programming Questions!