Select Git revision

Sofiane Lasri authored
ex5d.php 743 B
<?php
if(isset($_GET['seuil'])){
$atteindre = $_GET['seuil'];
}else{
$atteindre = 18000;
}
if(isset($_GET['capitalInitial'])){
$init = $_GET['capitalInitial'];
}else{
$init = 10000;
}
if(isset($_GET['targetYears'])){
$targetYears = $_GET['targetYears'];
}else{
$targetYears = 10;
}
$taux = ($atteindre - $init) / $targetYears;
$total = $init;
$nbAnnees = 0;
while($total < $atteindre){
$total *= $taux;
$nbAnnees++;
}
?>
<h1>Dépassement d'un seuil donné</h1>
<p>Seuil à atteindre : <?=$atteindre?> €</p>
<p>Captial Intial : <?=$init?> €</p>
<p>Taux d'intérêt pour <?=$targetYears?> année(s) : <?php echo ($taux - 1) * 100; ?> %</p>
<p>Capital en début d'année <?=$nbAnnees?> : <?=$total?> €</p>