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 simpleinterest and compoundinterest. 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
Compound Interest Principal RateYears
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
