aboutsummaryrefslogtreecommitdiff
path: root/bank.pl
blob: 927012c51ecd2a1ccfe663ed918cb22df6ae0179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}