0% found this document useful (0 votes)
33 views

java Program Employee - Management Program

This Java program defines an Employee class with methods to input employee data like name and basic salary, calculate allowances, gross salary, deductions, and net salary, and display the employee's name and net salary. The main method creates an Employee object, calls the input, calculate, and display methods to manage employee payroll information. When run, it prompts the user to enter name and basic salary, performs the calculations, and prints the name and net salary.

Uploaded by

Sathish Sät Sk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

java Program Employee - Management Program

This Java program defines an Employee class with methods to input employee data like name and basic salary, calculate allowances, gross salary, deductions, and net salary, and display the employee's name and net salary. The main method creates an Employee object, calls the input, calculate, and display methods to manage employee payroll information. When run, it prompts the user to enter name and basic salary, performs the calculations, and prints the name and net salary.

Uploaded by

Sathish Sät Sk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

//JAVA PROGRAM EMPLOYEE_MANAGEMENT PROGRAM

import java.util.*; //scanner


import java.io.*; //println

class employee{
int basic_saly,medicial_allw,homerentallw, travel_allw,allowance;
int basic_sal,gross_salary,pension_fund, paid_leave,income_tax,deduction,net_salary;
String name;
void input(){

Scanner in=new Scanner(System.in);

System.out.println("enter your name");


name=in.nextLine(); //NEXT (WITHOUT SPACE) NEXTLINE (WITH SPACE)
System.out.println("enter ur basic salary");

basic_sal=in. nextInt();
}
void calculate()
{
medicial_allw=(basic_saly*10)/100;
homerentallw=(basic_saly*10)/100;
trave_lallw=(basic_saly*10)/100;

allowance=medicial_allw+homerentallw+travelallw;

gross_salary=basic_sal+allowance;
pension_fund=(gross_salary*10)/100;
paid_leave=(gross_salary*10)/100;
incometax=(gross_salary*10)/100;

Deduction =pension_fund +paid_leave+income_tax;

net_salary=gross_salary-deduction;
}
void display(){
System.out.println("your NAME :"+name);
System.out.println("your NET_SALARY :"+net_salary);
}
}

class employee_management
{
public static void main(String args[])
{
employee e1=new employee();
e1.input();
e1.calculate();
e1.display();
}
}

OUTPUT:

F:\java file>javac employeemanagement.java

F:\java file>java employee_management


enter your name
SATHISH KUMAR
enter ur basic salary
50000
your NAME :SATHISH KUMAR
your NET_SALARY :35000

You might also like