Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # First Name - Matt
- # Last Name - Lewis
- # ID: E00193806
- # Date - September 5, 2012
- # Assignment 1
- # Description: This program finds the adjusted gross income of a user's gross income.
- #Forces Variables to be used
- use strict;
- my $dependents;
- my $grossincome;
- my $adjustedgrossincome;
- my $combined;
- my $totaltax;
- print "Please enter your gross income: ";
- $grossincome=<STDIN>;
- print "Please enter your total number of dependents: ";
- $dependents=<STDIN>;
- $adjustedgrossincome=$grossincome-($dependents*3200);
- print "Your adjusted gross income is $adjustedgrossincome.\n";
- if ($adjustedgrossincome <=20000)
- {
- $totaltax=$adjustedgrossincome*.10;
- print "You will pay 10% of your AGI, which is $totaltax.\n";
- }
- elsif ($adjustedgrossincome >=20000)
- {
- $combined=$adjustedgrossincome-20000;
- $totaltax=2000+(.15*$combined);
- print "You will payy $totaltax in taxes.\n";
- }
- if ($adjustedgrossincome >40001)
- {
- $combined=$adjustedgrossincome-40000;
- $totaltax=5000+(.22*$combined);
- print "You will payyyy $totaltax in taxes.\n";
- }
- if ($adjustedgrossincome >100001)
- {
- $combined=$adjustedgrossincome-100000;
- $totaltax=18200+(.35*$combined);
- print "You will pay $totaltax in taxes.\n";
- }
- else
- {
- print "Nothing can be done here.\n";
- }
Add Comment
Please, Sign In to add comment