Write a program to input the basic salary of a person. He get 15% of the basic as HRA,
15% of the basic as Conveyance allowance and 10% of the basic as Entertainment
allowance. The total salary is calculated by adding Basic + HRA + Conveyance +
Entertainment Allowance. Calculate and print the total salary of person.
Answers
Answered by
9
Answer:
Class employee
{
public static void main (string args[])
{
Scanner sc = new Scanner ( System.in);
System.out.println("Enter the name of the employee");
string nm = in.next();
System.out.println ("Enter the basic salary")
int sal = in.nextInt();
{
double da , hra ,pf, gp =0.00, np=0.00;
da = 0.30*sal;
hra=12.5*sal;
pf=0.10*sal;
gp = sal+ da+hra;
np = gp - pf;
}
System.out.println(" Name of the employee :"+nm);
System.out.println("Basic salary : "+sal);
System.out.println("Gross salary :"+ gp);
System.out.println(" Net salary "+np);
}}
Explanation:
Similar questions
English,
3 hours ago
English,
3 hours ago
English,
3 hours ago
Physics,
6 hours ago
Computer Science,
6 hours ago
Computer Science,
7 months ago
English,
7 months ago