Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TaxCalculator {
- int income = 0;
- int notax = 100;
- double firstband = 150;
- double secondband = 0.2;
- double thirdband = 0.4;
- double truncation = 0.5;
- Scanner keyboard = new Scanner(System.in);
- public void payableTax() {
- //do code here to take user input scanner and return the tax
- //through splitting of user input
- System.out.println("Please enter your child's income to be taxed.");
- income = keyboard.nextInt();
- //okay, now we have the value of income, lets work out tax rate
- //boolean time
- //if less/equal to 100, no tax, print out
- if(income<=notax);{
- System.out.println("There is no payable tax on this income");
- }
- if (income<=firstband);{
- int remainder = 0;
- //do income -100, then times remainder by 0.1. print this
- //add +0.5 to make it a whole.
- income - notax = remainder;
- System.out.println("The payable tax on" + income + "is" + remainder + ".");
- }
- while (income<=notax);{
- int remainder = 0;
- //do income -100, then times remainder by 0.1. print this
- //add +0.5 to make it a whole.
- income - notax = remainder;
- System.out.println("The payable tax on" + income + "is" + remainder + ".");
- }
- }
- public static void main(String[] args) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement