[Solved]1 Write Method Named Invest Computes Return Total Interest Earned Financial E Per Year Ban Q37169343
in java please
1. Write a method named invest that computes and return the total interest earned on a financial e per year, the bank pays interest to the investor at a given fixed rate. As the investment. Onc investment earns interest, that interest is added to the investment and therefore the interest begins earning interest of its own (“compounding”) Your method should accept three parameters in the main function: the initial amount of the investment in dollars (as a real number such as 1500.0 for $1,500.00), the yearly interest rate (as a real number such as 3.5 for 3.5% interest) and the number of years for which to invest (as an integer such as 6 for 6 years) and then returns the total interest earned (as a real number such as 35.60 for $35.60) Your method should print the value of the investment after each year. Upon return, your program should print cumulative interest earned over all years in the main function. For example, an investment of $100.00 at 10% interest for 5 years would lead to this call // $100.00 at 10% interest for 5 years double totalInterest invest (100.00, 10.0, 5); The call would produce the following console output. Dollar amounts print with 2 digits after the decimal. run MyInvest After year 1: $110.00 After year 2: $121.00 After year 3: $133 After year 4: $146 After year 5: $161.05 Total interest earned: $61.05 .10 .41 Notice that we are not simply adding 10% of $100.00 (or $10.00) each year, that would lead to $50 of total interest earned. The first year adds 10% of $100.00, but the second year adds 10% of $110.00, or $11.00, leading to a total of $121.00. The third year a $12.10, leading to a total of $133.10 and so on. The interest is cumulative. You may assume that all parameter values passed are non-negative dds 10% of $121.00, or Show transcribed image text 1. Write a method named invest that computes and return the total interest earned on a financial e per year, the bank pays interest to the investor at a given fixed rate. As the investment. Onc investment earns interest, that interest is added to the investment and therefore the interest begins earning interest of its own (“compounding”) Your method should accept three parameters in the main function: the initial amount of the investment in dollars (as a real number such as 1500.0 for $1,500.00), the yearly interest rate (as a real number such as 3.5 for 3.5% interest) and the number of years for which to invest (as an integer such as 6 for 6 years) and then returns the total interest earned (as a real number such as 35.60 for $35.60) Your method should print the value of the investment after each year. Upon return, your program should print cumulative interest earned over all years in the main function. For example, an investment of $100.00 at 10% interest for 5 years would lead to this call // $100.00 at 10% interest for 5 years double totalInterest invest (100.00, 10.0, 5); The call would produce the following console output. Dollar amounts print with 2 digits after the decimal. run MyInvest After year 1: $110.00 After year 2: $121.00 After year 3: $133 After year 4: $146 After year 5: $161.05 Total interest earned: $61.05 .10 .41 Notice that we are not simply adding 10% of $100.00 (or $10.00) each year, that would lead to $50 of total interest earned. The first year adds 10% of $100.00, but the second year adds 10% of $110.00, or $11.00, leading to a total of $121.00. The third year a $12.10, leading to a total of $133.10 and so on. The interest is cumulative. You may assume that all parameter values passed are non-negative dds 10% of $121.00, or
Expert Answer
Answer to 1. Write a method named invest that computes and return the total interest earned on a financial e per year, the bank pa… . . .
OR

