import java.util.Scanner; public class Task9{ public static void main(String args[]){ Scanner input = new Scanner(System.in); System.out.println("Enter your basic salary: "); int basicSalary = input.nextInt(); int houseRentAlowance = 0,medicalAllowance = 0; if(basicSalary < 10000){ houseRentAlowance = (basicSalary * 50) / 100; medicalAllowance = (basicSalary * 10) / 100; } else if(basicSalary >= 10000 && basicSalary <= 20000){ houseRentAlowance = (basicSalary * 60) / 100; medicalAllowance = (basicSalary * 15) / 100; } else if(basicSalary > 20000){ houseRentAlowance = (basicSalary * 70) / 100; medicalAllowance = (basicSalary * 20) / 100; } int grossSalary = basicSalary + houseRentAlowance + medicalAllowance; System.out.printf("The gross salary is %d",grossSalary); } }