Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Problem4{
- public static void main(String[]args){
- BufferedReader ben = new BufferedReader(new InputStreamReader(System.in));
- double GrossIncome = 0;
- double deduction = 0;
- double NetIncome = 0;
- double tax = 0;
- try{
- System.out.print("Input gross income: ");
- GrossIncome = Integer.parseInt(ben.readLine());
- System.out.print("Input total deduction: ");
- deduction = Integer.parseInt(ben.readLine());
- if(GrossIncome>100000){
- tax = GrossIncome*.2;
- NetIncome = GrossIncome-tax-deduction;
- System.out.println("Net Income is: "+NetIncome);}
- else if(50000<GrossIncome&&GrossIncome<100000){
- tax = GrossIncome*.15;
- NetIncome = GrossIncome-tax-deduction;
- System.out.println("Net Income is: "+NetIncome);}
- else{
- tax = GrossIncome*.1;
- NetIncome = GrossIncome-tax-deduction;
- System.out.println("Net Income is "+NetIncome);}
- }catch(IOException e){
- System.out.println("Error");}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement