Can someone plzzzzzzz check this?
import java.io.*; class Incometax { public static void main(String[]args)throws IOException { BufferedReader keyboard = new BufferedReader (new InputStreamReader(System.in)); int grossSalary; char personalStatus; int personalAllowance; int noOfChildren; int childAllowance; int taxableIncome = 0; double incomeTax; System.out.print("Enter gross salary:"); grossSalary = Integer.parseInt(keyboard.readLine()); System.out.print("Enter personal status:"); personalStatus = (char) keyboard.read(); if(personalStatus == 'm') { personalAllowance = 1200; System.out.print("Enter number of children:"); noOfChildren = Integer.parseInt(keyboard.readLine()); childAllowance=100*noOfChildren; taxableIncome=grossSalary-(childAllowance+personalAllowance); } else if(personalStatus == 's') { personalAllowance = 2300; taxableIncome=grossSalary-personalAllowance; } else { System.out.println("Wrong letter entered "); } if(taxableIncome<1000) { System.out.println("No tax "); } else if(taxableIncome<2000) { incomeTax=(taxableIncome-1000)*0.20; System.out.println(incomeTax); } else if(taxableIncome<4000) { incomeTax=(1000*0.20)+((taxableIncome-2000)*0.30); System.out.println(incomeTax); } else { incomeTax=(1000*0.20)+(2000*0.30)+(taxableIncome-4000)*0.40; System.out.println(incomeTax); } } }
Could you please explain what you're trying to do and what you're having problems with?
Join our real-time social learning platform and learn together with your friends!