Created
August 6, 2019 15:58
-
-
Save ramcoelho/8b7ffcd9bc957144d762ce34f9f137d8 to your computer and use it in GitHub Desktop.
Cálculo de juros com aportes regulares
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Configuração | |
$taxa = 1.01; // 1% ao período | |
$períodos = 10; | |
$aporte = 100; // Aporte por período | |
// Cálculo | |
$acumulado = 0; | |
while ($periodos-- > 0) { | |
$acumulado++; | |
$acumulado *= $taxa; | |
} | |
$saldo = $acumulado * $aporte; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment