Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class TaxCalculator {
  5.  
  6. int income = 0;
  7. int notax = 100;
  8. double firstband = 150;
  9. double secondband = 0.2;
  10. double thirdband = 0.4;
  11. double truncation = 0.5;
  12. Scanner keyboard = new Scanner(System.in);
  13.  
  14.  
  15. public void payableTax() {
  16. //do code here to take user input scanner and return the tax
  17. //through splitting of user input
  18. System.out.println("Please enter your child's income to be taxed.");
  19. income = keyboard.nextInt();
  20. //okay, now we have the value of income, lets work out tax rate
  21. //boolean time
  22. //if less/equal to 100, no tax, print out
  23.  
  24. if(income<=notax);{
  25. System.out.println("There is no payable tax on this income");
  26.  
  27. }
  28. if (income<=firstband);{
  29. int remainder = 0;
  30. //do income -100, then times remainder by 0.1. print this
  31. //add +0.5 to make it a whole.
  32. income - notax = remainder;
  33. System.out.println("The payable tax on" + income + "is" + remainder + ".");
  34. }
  35.  
  36.  
  37. while (income<=notax);{
  38. int remainder = 0;
  39. //do income -100, then times remainder by 0.1. print this
  40. //add +0.5 to make it a whole.
  41. income - notax = remainder;
  42. System.out.println("The payable tax on" + income + "is" + remainder + ".");
  43.  
  44. }
  45.  
  46.  
  47.  
  48.  
  49. }
  50.  
  51. public static void main(String[] args) {
  52.  
  53.  
  54.  
  55.  
  56. }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement