SHARE
TWEET

GiftTax

a guest Feb 14th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class GiftTax {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.  
  9.         System.out.println("Value of the gift?");
  10.         double value = Integer.valueOf(scan.nextLine());
  11.  
  12.         if (value < 5000) {
  13.             System.out.println("No tax!");
  14.         } else if (value >= 5000 && value <25000) {
  15.             System.out.println("Tax:" + (100+(0.08*(value - 5000))));
  16.         } else if (value >= 25000 && value <55000) {
  17.             System.out.println("Tax:" + (1700 + (0.1 * (value - 25000))));
  18.         } else if (value >= 55000 && value <200000) {
  19.             System.out.println("Tax:" + (4700+(0.12*(value - 55000))));
  20.         } else if (value >= 200000 && value <1000000) {
  21.             System.out.println("Tax:" + (22100+(0.15*(value - 200000))));
  22.         } else if (value >= 1000000) {
  23.             System.out.println("Tax:" + (142100 + (0.17 * (value - 1000000))));
  24.         }
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top