123456/H5 2425/functies.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Functies</title> </head> <body> <?php function contributie($age, $trainingen, $korting = 0 ){ $bedrag = 100 + $age * 3 + $trainingen * 50 - $korting; return $bedrag; } $trainingen = 2; for($l=8;$l<=86;$l++){ echo "<p>"; for($t=1;$t<=3;$t++){ $pipo = contributie($l, $t); echo "<div>Als je $l bent en je traint $t per week, dan is je contributie $pipo euro.</div>"; } echo "</p>"; } ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse