<?php
$deposit = 100;
$rate = .05;
$year = 0;
$total = 100;
$total_noninterest = 100;
echo "Year\tBalance\tInterest\tTotal\n";
while($year < 5){
$interest += $total_noninterest * $rate;
$total += $total_noninterest + $interest;
$total_noninterest += $deposit;
$year++;
}
//echo "-------------------------" . "\n<strong> Total: " . number_format($total,2);
IDw/cGhwCiRkZXBvc2l0ID0gMTAwOwokcmF0ZSA9IC4wNTsKJHllYXIgPSAwOwokdG90YWwgPSAxMDA7CiR0b3RhbF9ub25pbnRlcmVzdCA9IDEwMDsKCmVjaG8gIlllYXJcdEJhbGFuY2VcdEludGVyZXN0XHRUb3RhbFxuIjsKd2hpbGUoJHllYXIgPCA1KXsKICAgIGVjaG8gc3RyX3BhZCgkeWVhciwgNSkgLiAiXHQiOwogICAgZWNobyBzdHJfcGFkKG51bWJlcl9mb3JtYXQoJHRvdGFsX25vbmludGVyZXN0LDIpLCAxMCkgLiAiXHQiOwogICAgJGludGVyZXN0ICs9ICR0b3RhbF9ub25pbnRlcmVzdCAqICRyYXRlOwogICAgZWNobyBudW1iZXJfZm9ybWF0KCRpbnRlcmVzdCwyKSAuICJcdCI7CiAgICAKICAgICR0b3RhbCArPSAkdG90YWxfbm9uaW50ZXJlc3QgKyAkaW50ZXJlc3Q7CiAgICBlY2hvIHN0cl9wYWQobnVtYmVyX2Zvcm1hdCgkdG90YWwsMiksIDEwKSAuICJcbiI7CiAgICAkdG90YWxfbm9uaW50ZXJlc3QgKz0gJGRlcG9zaXQ7CgkkeWVhcisrOwp9CgovL2VjaG8gIi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iIC4gIlxuPHN0cm9uZz4gVG90YWw6ICIgLiBudW1iZXJfZm9ybWF0KCR0b3RhbCwyKTsK