Display the gross salary 50% DA and 40% HRA

import java.util.*;
class salary
{
public static void main(String args[])
{
Scanner st=new Scanner(System.in);
float basic,hra,da,gross;
System.out.println("Enter the basic salary of employee");
basic=st.nextFloat();
hra=40*basic/100;
da=50*basic/100;
gross=basic+da+hra;
System.out.println("the total salary including Hra,Da:"+gross);
}
}
OUTPUT:
Enter the basic salary of employee
9000
the total salary including Hra,Da:17100
Translate »