diff options
Diffstat (limited to 'bank.pl')
-rw-r--r-- | bank.pl | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +#!/usr/bin/perl -w + +my $debt = shift || 1000; +my $idebt = $debt; + +my $months = shift || 100; +for(1..$months) { + $debt += $debt * 0.005; + $idebt += ($idebt >> 8) + ($idebt >> 10); + # print "$debt\t$idebt\n"; + $pct = $idebt * 100 / $debt; + printf("%.2d\t$idebt\t%.1d%%\n", $debt, $pct); +} |