Calculo

public class Servico {

double valoFinanciar = 1000;
int parcelas = 3;
double taxaJuros = 0.05;

private double valorParcela(){
double m =1;

for (int i = 0; i < this.parcelas; i++ ){ m = m * (1 + this.taxaJuros); } double pmt = this.valoFinanciar * this.taxaJuros / (1 - 1/m); return pmt; } public static void main(String[] args) { Servico ser = new Servico(); System.out.println(String.format("%.2f", ser.valorParcela())); } }