Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Please enter the initial balance: ");
double initialBalance = input.nextDouble();
System.out.print("Please enter the annual interest rate: ");
double annualInterestRate = input.nextDouble();
double monthlyInterest = (annualInterestRate / 100) / 12;
double currentBalance = initialBalance + (initialBalance * monthlyInterest);
for(int month=1; month<=3; month++){
System.out.printf("Balance after month " + month + ": %.2f \n", ((initialBalance + (initialBalance * monthlyInterest)* month)));
}
}
}
Explanation:
* The provided code is developed in Java
- Requests the user to provide the initial balance and the annual interest rate
- Computes the monthly interest rate
- Determines the current balance
- Calculates the balance amount after the first three months, utilizing a loop for repetition