Calculate Salary Tax

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package salarytax;

import java.util.Scanner;

/**
*
* @author saeed
*/
public class SalaryTax {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);

// TODO code application logic here
System.out.print("Enter the Salary ");
int salary=scan.nextInt();
int tax=0;
if(salary<=10000){
tax=salary*5/100;
         }else if ((salary>10000)&&(salary<=20000)){
tax=salary*10/100;
     }else if(salary>20000){
tax=salary*15/100;
  }
salary=salary-tax;
System.out.println("Your Tax Amount ="+tax);
System.out.println("Your Paybale Salary ="+salary);
             }
}

Comments

Popular posts from this blog

Unlock Your Future in Cybersecurity with Expert Online Training!

Binary Search Using C Language