answersLogoWhite

0

/* hra=25% of salary

* ca=15% of salary

* ea=10% of salary

* total salary= hra + ca + ea

*/

import java.io.*;

class pay

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the salary: ");

int sal=Integer.parseInt(in.readLine());

float tsal=sal;

if(sal>5000)

{

float hra,ca,ea;

hra=sal/4;

ca=(sal*3)/20;

ea=sal/10;

tsal=sal+hra+ca+ea;

}

System.out.print("Total Salary= "+tsal);

}

}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
JudyJudy
Simplicity is my specialty.
Chat with Judy

Add your answer:

Earn +20 pts
Q: Write a program in java to print total salary of an employee?
Write your answer...
Submit
Still have questions?
magnify glass
imp