aboutsummaryrefslogtreecommitdiff
path: root/bank.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bank.pl')
-rw-r--r--bank.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/bank.pl b/bank.pl
new file mode 100644
index 0000000..927012c
--- /dev/null
+++ b/bank.pl
@@ -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);
+}