Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @(#)IRS.java
- *
- * IRS application
- *
- * @author
- * @version 1.00 2012/9/30
- */
- import java.util.Scanner; //importing scanner so one can imput values
- public class IRS {
- public static void main(String[] args) {
- Scanner Input = new Scanner(System.in); //activates scanner
- int choice; //defining variable
- int income = 0; //defining variable
- int total; //defining variable
- int upperClass = 200000; //completely made up, but incomes for upper, middle, and lower class. using that later on
- int middleClass = 90000;
- int lowerClass = 50000;
- int nygiants;
- int cate;
- System.out.println("\nHello, And Welcome To Your Tax Calculator.");
- System.out.println("\n\nAre You Married Or Single? \n\nFor 'Single', Press 1. \nFor 'Married', Press 2.\n"); //single or married?
- choice = Input.nextInt ( ); //thats where the input is being aactivated
- if(choice == 1) //if single
- {
- System.out.println("\nGood For You. Now, Enter Your Yearly Income Rounded To The Nearest Dollar.\n"); //asking for income
- income = Input.nextInt ( );
- if(income <= 27050)
- {
- System.out.println("\nTerrific. You Owe The State " + (income * 0.15)); //if income is less than 27050, thats the output
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- }
- else if(income <= 65550)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 27050) * 0.275 + 4057.5) + "$"); //more than 27050 less than 65550
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income <= 136750)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 65550) * 0.305 + 14645) + "$"); //more than 65550 less than 136750
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income <= 297350)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 136750) * 0.355 + 36361) + "$"); //more than 136750 less than 297350
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income >= 297350)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 297350) * 0.391 + 93374) + "$"); //more than 297350
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(choice == 2) //if married
- {
- System.out.println("\nOK. Now, Enter Your Yearly Income Rounded To The Nearest Dollar.\n");
- income = Input.nextInt ( );
- if(income <= 45200)
- {
- System.out.println("\nTerrific. You Owe The State " + (income * 0.15)); //if income is less than 45200, thats the output
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income <= 109250)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 45200) * 0.275 + 6780) + "$"); //more than 45200, less than 109250
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income <= 166500)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 109250) * 0.305 + 24393.75) + "$"); //more than 109250, less than
- } //166500
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income <= 297350)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 166500) * 0.355 + 41855) + "$"); //more than 166500, less than 297350
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- else if(income >= 297350)
- {
- System.out.println("\nTerrific. You Owe The State " + ((income - 297350) * 0.391 + 88306) + "$"); //more than 297350
- }
- System.out.println("Now, Would You Like To Compare Your Yearly Income To The Average Income Of The Class You Consider Yourself In?");
- System.out.println("\n\n1. Yes\n\n2. No");
- nygiants = Input.nextInt ( );
- if(nygiants == 1)
- {
- System.out.println("Which Class Do You Think Suits You Most?\n\nupperClass\n\nmiddleClass\n\nlowerClass");
- System.out.println("\n\nPlease Type Class Exactly The Way Shown Above (ex. lowerClass");
- cate = Input.nextInt ( );
- if(cate == upperClass)
- {
- System.out.println(("You Make About ") + (income / upperClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == middleClass)
- {
- System.out.println(("You Make About ") + (income / middleClass) + ("% Of The Class You See Yourself In"));
- }
- else if(cate == lowerClass)
- {
- System.out.println(("You Make About ") + (income / lowerClass) + ("% Of The Class You See Yourself In"));
- }
- else if(nygiants == 2)
- {
- System.out.println("Ok. Have A Great Day!");
- }
- }
- }
- //when somebody accidentally doesnt select 1 or 2
- else
- {
- System.out.println("\nError. Please Start Over");
- } //when somebody accidentaly doesnt select 1 or 2
- }
- }
Add Comment
Please, Sign In to add comment