Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- print "What's your retirement goal number?\n";
- my $retirement_goal = <stdin>;
- print "What's your net worth?\n";
- my $net_worth = <STDIN>;
- print "How many years untl you retire?\n";
- my $years_until_retirement = <STDIN>;
- my $daily_amount = $retirement_goal / 365;
- print "You have " . int($net_worth / $daily_amount) . " days of retirement covered\n";
- print "Or " . int(($net_worth * .04) / 365) . " dollars a day to spend if you retired today\n";
- print "Every " . int($daily_amount / (1 + .07)**$years_until_retirement) . " dollars deposited today gets you another day of retirement assuming 7% interest\n";
- print "Every " . int($daily_amount / (1 + .15)**$years_until_retirement) . " dollars deposited today gets you another day of retirement assuming 15% interest\n";
- print "Or " . int(($daily_amount / (1 + .07)**$years_until_retirement) / 24) . " dollars deposited gets you another hour\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement