Java Program to Calculate Salary for Employees
Get employee wages and number of days worked from user and find Basic Pay, DA, HRA, PF and Net Pay. (Note HRA, DA and PF are 10%,5%and 12% of basicpay respectively.)
Sample Input 1: 300 30
Sample Output 1:
Basic Pay:3000
DA: 150 HRA:300
PF:360
Net Pay: 3090
Flow Chart Design
Try your Solution
Strongly recommended to Solve it on your own, Don't directly go to the solution given below.
public class Hello
{
public static void main(String args[])
{
//Write your code here
}
}
Program or Solution
//To Calculate The Salary Of Employess...
import java.util.*;
class Program
{
public static void main(String args[])
{
int wages,days;
double basic,HRA,DA,PF,netsalary;
Scanner sc=new Scanner(System.in);
System.out.println("Enter The No.Of Days:");
days=sc.nextInt();
System.out.println("Enter The Wages:");
wages=sc.nextInt();
basic=wages*days;
HRA=basic*0.1;
DA=basic*0.05;
PF=basic*0.12;
netsalary=basic+HRA+DA-PF;
System.out.println("The Basic Pay Is:"+basic);
System.out.println("The HRA Is:"+HRA);
System.out.println("The DA Is:"+DA);
System.out.println("The PF Is:"+PF);
System.out.println("The NETSALARY Is:"+netsalary);
}
}
Program Explanation
Comments
Related Programs
- Java Program to Addition of two numbers
- Java Program to subtraction of two numbers
- Java Program to multiply two numbers
- Java Program to divide two numbers
- Java Program to find modulus of two numbers
- Java Program to Kilo Meters to Meters
- Java Program to Meters to Kilo Meters
- Java Program to find area of Square
- Java Program to find area of Rectangle
- Java Program to find area of Right-angled triangle
- Java Program to find area of triangle
- Java Program to find area of Circle (Use Constant)
- Java Program to find the distance between two points in 2D space
- Java Program to calculate kilobytes to bytes
- Java Program to calculate bytes to kilobytes
- Java Program to find simple interest
- Java Program to calculate Fahrenheit to Celsius
- Java Program to calculate Celsius to Fahrenheit
- Java Program to Swap two numbers using third variable
- Java Program to Swap of two numbers without using third variable
- Java Program to print the last digit of given number N
- Post Increment Operator Example in Java
- Pre Increment Operator Example in Java
- Pre Increment and Post Increment Difference in java with Example
- Ternary Operator Example in Java
- Relational Operators Example in java
- Logical Operators Example in Java
coming Soon
coming Soon