Guest User

Untitled

a guest
Oct 19th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.28 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # First Name - Matt
  4. # Last Name - Lewis
  5. # ID: E00193806
  6. # Date - September 5, 2012
  7. # Assignment 1
  8. # Description: This program finds the adjusted gross income of a user's gross income.
  9.  
  10. #Forces Variables to be used
  11. use strict;
  12.  
  13. my $dependents;
  14. my $grossincome;
  15. my $adjustedgrossincome;
  16. my $combined;
  17. my $totaltax;
  18.  
  19. print "Please enter your gross income: ";
  20. $grossincome=<STDIN>;
  21.  
  22. print "Please enter your total number of dependents: ";
  23. $dependents=<STDIN>;
  24.  
  25. $adjustedgrossincome=$grossincome-($dependents*3200);
  26.  
  27. print "Your adjusted gross income is $adjustedgrossincome.\n";
  28.  
  29. if ($adjustedgrossincome <=20000)
  30. {
  31.     $totaltax=$adjustedgrossincome*.10;
  32.     print "You will pay 10% of your AGI, which is $totaltax.\n";
  33. }
  34.  
  35. elsif ($adjustedgrossincome >=20000)
  36. {
  37.     $combined=$adjustedgrossincome-20000;
  38.     $totaltax=2000+(.15*$combined);
  39.     print "You will payy $totaltax in taxes.\n";
  40. }
  41.  
  42. if ($adjustedgrossincome >40001)
  43. {
  44.     $combined=$adjustedgrossincome-40000;
  45.     $totaltax=5000+(.22*$combined);
  46.     print "You will payyyy $totaltax in taxes.\n";
  47. }
  48.  
  49. if ($adjustedgrossincome >100001)
  50. {
  51.     $combined=$adjustedgrossincome-100000;
  52.     $totaltax=18200+(.35*$combined);
  53.     print "You will pay $totaltax in taxes.\n";
  54. }
  55.  
  56. else
  57. {
  58.     print "Nothing can be done here.\n";
  59. }
Add Comment
Please, Sign In to add comment