Suppose we want to compute the amount of money in a bank account with compound interest. If the amount of money in the account is m, the amount in the account at the end of the month will be 1.005m. Write a recursive method that will compute the amount of money in an account after t months with a starting amount of m.

What will be an ideal response?


```
public static double compoundInterest(double start, int months){
double result;

if(months <= 0){
result = start;
} else {
result = 1.005 * compoundInterest(start, months-1);
}

return result;

}
```

This code is in Methods.java.

Computer Science & Information Technology

You might also like to view...

In JavaScript, lexigraphical sorting treats numbers as characters.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

If there are a lot of groups within a field, it is better to put those fields across the top in the columns of a PivotTable instead of along the row side

Indicate whether the statement is true or false

Computer Science & Information Technology

The Step-by-Step Mail Merge Wizard can also be used to generate envelopes and labels.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Translating informational data into real dollars is the easiest part of asset valuation.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology