answersLogoWhite

0


Best Answer

/* 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

14y ago
This answer is:
User Avatar

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
Related questions

Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a unix program to print print a pattern?

echo 'print a pattern'


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


The distance between two cities in km is input through the keyboard write a program to convert and print this distance in meters feet inches and centimeters?

mesh's basic salary is input through the keyboard. his dearness allowance is 40% of basic salarying , and house rent allowance is 20% of basic salaried. write a program to calculate his gross salary


Write a program to print the sum of a sparse matrix?

This is a directive, not a question.


Write a c program to print roman letters?

good morning


Can you Write a program in 'c' to print symbols of playing cards?

Yes.


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


Write c program to print?

include <stdio.h> int main (void) { puts ("print"); return 0; }


Write a C Program to print sum of squares of odd numbers?

#include


Write a c program to print the 100 to 1 nos?

Write a c program to print the 100 to 1 nos