Guest User

Untitled

a guest
Dec 9th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 25.64 KB | None | 0 0
  1. /**
  2.  * @(#)IRS.java
  3.  *
  4.  * IRS application
  5.  *
  6.  * @author
  7.  * @version 1.00 2012/9/30
  8.  */
  9.  
  10.  
  11. import java.util.Scanner; //importing scanner so one can imput values
  12. public class IRS {
  13.    
  14.     public static void main(String[] args) {
  15.        
  16.    
  17.         Scanner Input = new Scanner(System.in); //activates scanner
  18.        
  19.         int choice; //defining variable
  20.         int income = 0; //defining variable
  21.         int total;  //defining variable
  22.         int upperClass = 200000; //completely made up, but incomes for upper, middle, and lower class. using that later on
  23.         int middleClass = 90000;
  24.         int lowerClass = 50000;
  25.         int nygiants;
  26.         int cate;
  27.        
  28.         System.out.println("\nHello, And Welcome To Your Tax Calculator.");
  29.         System.out.println("\n\nAre You Married Or Single? \n\nFor 'Single', Press 1. \nFor 'Married', Press 2.\n"); //single or married?
  30.        
  31.         choice = Input.nextInt ( ); //thats where the input is being aactivated
  32.        
  33.            if(choice == 1) //if single
  34.                
  35.         {
  36.                
  37.                 System.out.println("\nGood For You. Now, Enter Your Yearly Income Rounded To The Nearest Dollar.\n"); //asking for income
  38.                
  39.                 income = Input.nextInt ( );
  40.                
  41.                
  42.                
  43.                 if(income <= 27050)
  44.                 {
  45.                         System.out.println("\nTerrific. You Owe The State " + (income * 0.15)); //if income is less than 27050, thats the output
  46.                 }
  47.                         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  48.                         System.out.println("\n\n1. Yes\n\n2. No");
  49.                                
  50.                 nygiants = Input.nextInt ( );
  51.                        
  52.                         if(nygiants == 1)
  53.                         {
  54.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  55.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  56.                                        
  57.                                 cate = Input.nextInt ( );
  58.                                
  59.                                 if(cate == upperClass)
  60.                                 {
  61.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  62.                                 }
  63.                                
  64.                                 else if(cate == middleClass)
  65.                                 {
  66.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  67.                                 }
  68.                                
  69.                                 else if(cate == lowerClass)
  70.                                 {
  71.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  72.                                 }
  73.                                        
  74.                         else if(nygiants == 2)
  75.                         {
  76.                                 System.out.println("Ok. Have A Great Day!");
  77.                         }
  78.                         }
  79.                        
  80.                         }
  81.                
  82.                
  83.                 else if(income <= 65550)
  84.                 {
  85.                         System.out.println("\nTerrific. You Owe The State " + ((income - 27050) * 0.275 + 4057.5) + "$"); //more than 27050 less than 65550    
  86.                 }                                                                                                                                                                                                          
  87.                
  88.                 System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  89.                         System.out.println("\n\n1. Yes\n\n2. No");
  90.                                
  91.                 nygiants = Input.nextInt ( );
  92.                        
  93.                         if(nygiants == 1)
  94.                         {
  95.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  96.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  97.                                        
  98.                                 cate = Input.nextInt ( );
  99.                                
  100.                                 if(cate == upperClass)
  101.                                 {
  102.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  103.                                 }
  104.                                
  105.                                 else if(cate == middleClass)
  106.                                 {
  107.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  108.                                 }
  109.                                
  110.                                 else if(cate == lowerClass)
  111.                                 {
  112.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  113.                                 }
  114.                                        
  115.                         else if(nygiants == 2)
  116.                         {
  117.                                 System.out.println("Ok. Have A Great Day!");
  118.                         }
  119.                         }
  120.                        
  121.                                                                                                                                                                                                                                  
  122.                 else if(income <= 136750)                                                                                                                                                              
  123.                 {
  124.                         System.out.println("\nTerrific. You Owe The State " + ((income - 65550) * 0.305 + 14645) + "$"); //more than 65550 less than 136750
  125.                 }                                                                                                                                                                                                        
  126.                
  127.                 System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  128.                         System.out.println("\n\n1. Yes\n\n2. No");
  129.                                
  130.                 nygiants = Input.nextInt ( );
  131.                        
  132.                         if(nygiants == 1)
  133.                         {
  134.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  135.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  136.                                        
  137.                                 cate = Input.nextInt ( );
  138.                                
  139.                                 if(cate == upperClass)
  140.                                 {
  141.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  142.                                 }
  143.                                
  144.                                 else if(cate == middleClass)
  145.                                 {
  146.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  147.                                 }
  148.                                
  149.                                 else if(cate == lowerClass)
  150.                                 {
  151.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  152.                                 }
  153.                                        
  154.                         else if(nygiants == 2)
  155.                         {
  156.                                 System.out.println("Ok. Have A Great Day!");
  157.                         }
  158.                         }
  159.                        
  160.                 else if(income <= 297350)
  161.                 {
  162.                         System.out.println("\nTerrific. You Owe The State " + ((income - 136750) * 0.355 + 36361) + "$"); //more than 136750 less than 297350          
  163.                 }                                                                                                                                                                                                        
  164.                                                                
  165.                 System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  166.                         System.out.println("\n\n1. Yes\n\n2. No");
  167.                                
  168.                 nygiants = Input.nextInt ( );
  169.                        
  170.                         if(nygiants == 1)
  171.                         {
  172.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  173.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  174.                                        
  175.                                 cate = Input.nextInt ( );
  176.                                
  177.                                 if(cate == upperClass)
  178.                                 {
  179.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  180.                                 }
  181.                                
  182.                                 else if(cate == middleClass)
  183.                                 {
  184.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  185.                                 }
  186.                                
  187.                                 else if(cate == lowerClass)
  188.                                 {
  189.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  190.                                 }
  191.                                        
  192.                         else if(nygiants == 2)
  193.                         {
  194.                                 System.out.println("Ok. Have A Great Day!");
  195.                         }
  196.                         }
  197.                                                                                                                                                                        
  198.                 else if(income >= 297350)
  199.                 {
  200.                         System.out.println("\nTerrific. You Owe The State " + ((income - 297350) * 0.391 + 93374) + "$"); //more than 297350
  201.                 }                                                                                                                                                                                                        
  202.                
  203.                 System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  204.                         System.out.println("\n\n1. Yes\n\n2. No");
  205.                                
  206.                 nygiants = Input.nextInt ( );
  207.                        
  208.                         if(nygiants == 1)
  209.                         {
  210.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  211.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  212.                                        
  213.                                 cate = Input.nextInt ( );
  214.                                
  215.                                 if(cate == upperClass)
  216.                                 {
  217.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  218.                                 }
  219.                                
  220.                                 else if(cate == middleClass)
  221.                                 {
  222.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  223.                                 }
  224.                                
  225.                                 else if(cate == lowerClass)
  226.                                 {
  227.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  228.                                 }
  229.                                        
  230.                         else if(nygiants == 2)
  231.                         {
  232.                                 System.out.println("Ok. Have A Great Day!");
  233.                         }
  234.                         }
  235.                        
  236.        
  237.        
  238.             else if(choice == 2) //if married
  239.        
  240.         {
  241.                
  242.                 System.out.println("\nOK. Now, Enter Your Yearly Income Rounded To The Nearest Dollar.\n");
  243.                        
  244.                        
  245.                         income = Input.nextInt ( );
  246.                        
  247.                        
  248.                         if(income <= 45200)
  249.                         {
  250.                                 System.out.println("\nTerrific. You Owe The State " + (income * 0.15)); //if income is less than 45200, thats the output
  251.                         }
  252.                        
  253.                         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  254.                         System.out.println("\n\n1. Yes\n\n2. No");
  255.                                
  256.                         nygiants = Input.nextInt ( );
  257.                        
  258.                         if(nygiants == 1)
  259.                         {
  260.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  261.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  262.                                        
  263.                                 cate = Input.nextInt ( );
  264.                                
  265.                                 if(cate == upperClass)
  266.                                 {
  267.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  268.                                 }
  269.                                
  270.                                 else if(cate == middleClass)
  271.                                 {
  272.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  273.                                 }
  274.                                
  275.                                 else if(cate == lowerClass)
  276.                                 {
  277.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  278.                                 }
  279.                                        
  280.                         else if(nygiants == 2)
  281.                         {
  282.                                 System.out.println("Ok. Have A Great Day!");
  283.                         }
  284.                         }
  285.                        
  286.                         else if(income <= 109250)
  287.                         {
  288.                                 System.out.println("\nTerrific. You Owe The State " + ((income - 45200) * 0.275 + 6780) + "$"); //more than 45200, less than 109250
  289.                                                                                                                                                                                                                                                                
  290.                         }
  291.                        
  292.                         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  293.                         System.out.println("\n\n1. Yes\n\n2. No");
  294.                                
  295.                         nygiants = Input.nextInt ( );
  296.                        
  297.                         if(nygiants == 1)
  298.                         {
  299.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  300.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  301.                                        
  302.                                 cate = Input.nextInt ( );
  303.                                
  304.                                 if(cate == upperClass)
  305.                                 {
  306.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  307.                                 }
  308.                                
  309.                                 else if(cate == middleClass)
  310.                                 {
  311.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  312.                                 }
  313.                                
  314.                                 else if(cate == lowerClass)
  315.                                 {
  316.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  317.                                 }
  318.                                        
  319.                         else if(nygiants == 2)
  320.                         {
  321.                                 System.out.println("Ok. Have A Great Day!");
  322.                         }
  323.                         }
  324.                        
  325.                         else if(income <= 166500)
  326.                         {
  327.                                 System.out.println("\nTerrific. You Owe The State " + ((income - 109250) * 0.305 + 24393.75) + "$"); //more than 109250, less than                    
  328.                         }                                                                                                                                                                                                                //166500
  329.                        
  330.                         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  331.                         System.out.println("\n\n1. Yes\n\n2. No");
  332.                                
  333.                         nygiants = Input.nextInt ( );
  334.                        
  335.                         if(nygiants == 1)
  336.                         {
  337.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  338.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  339.                                        
  340.                                 cate = Input.nextInt ( );
  341.                                
  342.                                 if(cate == upperClass)
  343.                                 {
  344.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  345.                                 }
  346.                                
  347.                                 else if(cate == middleClass)
  348.                                 {
  349.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  350.                                 }
  351.                                
  352.                                 else if(cate == lowerClass)
  353.                                 {
  354.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  355.                                 }
  356.                                        
  357.                         else if(nygiants == 2)
  358.                         {
  359.                                 System.out.println("Ok. Have A Great Day!");
  360.                         }
  361.                         }
  362.                        
  363.                         else if(income <= 297350)
  364.                         {
  365.                                 System.out.println("\nTerrific. You Owe The State " + ((income - 166500) * 0.355 + 41855) + "$"); //more than 166500, less than 297350
  366.                         }
  367.                        
  368.                         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  369.                         System.out.println("\n\n1. Yes\n\n2. No");
  370.                                
  371.                         nygiants = Input.nextInt ( );
  372.                        
  373.                         if(nygiants == 1)
  374.                         {
  375.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  376.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  377.                                        
  378.                                 cate = Input.nextInt ( );
  379.                                
  380.                                 if(cate == upperClass)
  381.                                 {
  382.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  383.                                 }
  384.                                
  385.                                 else if(cate == middleClass)
  386.                                 {
  387.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  388.                                 }
  389.                                
  390.                                 else if(cate == lowerClass)
  391.                                 {
  392.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  393.                                 }
  394.                                        
  395.                         else if(nygiants == 2)
  396.                         {
  397.                                 System.out.println("Ok. Have A Great Day!");
  398.                         }
  399.                         }
  400.                        
  401.                         else if(income >= 297350)
  402.                         {
  403.                                 System.out.println("\nTerrific. You Owe The State " + ((income - 297350) * 0.391 + 88306) + "$"); //more than 297350
  404.                         }
  405.        
  406.         System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
  407.                         System.out.println("\n\n1. Yes\n\n2. No");
  408.                                
  409.                 nygiants = Input.nextInt ( );
  410.                        
  411.                         if(nygiants == 1)
  412.                         {
  413.                                 System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
  414.                                 System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
  415.                                        
  416.                                 cate = Input.nextInt ( );
  417.                                
  418.                                 if(cate == upperClass)
  419.                                 {
  420.                                         System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
  421.                                 }
  422.                                
  423.                                 else if(cate == middleClass)
  424.                                 {
  425.                                         System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
  426.                                 }
  427.                                
  428.                                 else if(cate == lowerClass)
  429.                                 {
  430.                                         System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
  431.                                 }
  432.                                        
  433.                         else if(nygiants == 2)
  434.                         {
  435.                                 System.out.println("Ok. Have A Great Day!");
  436.                         }
  437.                         }
  438.        
  439.     }
  440.  
  441.                               //when somebody accidentally doesnt select 1 or 2
  442.    
  443.         else
  444.         {
  445.                 System.out.println("\nError. Please Start Over");
  446.         }                                       //when somebody accidentaly doesnt select 1 or 2
  447.     }
  448. }
Add Comment
Please, Sign In to add comment