0% found this document useful (0 votes)
9 views9 pages

Employee Salary Calculation Program

The document contains a Java program that defines an Employee class and its subclasses for different roles such as Programmer, Team Lead, Assistant Project Manager, and Project Manager. Each class allows for input of employee details and salary calculations based on a basic salary, including components like DA, HRA, PF, and net salary. The program demonstrates the functionality through a main method that creates instances of each role and processes employee data.

Uploaded by

praut4236
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Employee Salary Calculation Program

The document contains a Java program that defines an Employee class and its subclasses for different roles such as Programmer, Team Lead, Assistant Project Manager, and Project Manager. Each class allows for input of employee details and salary calculations based on a basic salary, including components like DA, HRA, PF, and net salary. The program demonstrates the functionality through a main method that creates instances of each role and processes employee data.

Uploaded by

praut4236
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical 3

Name : Prathmesh Sanjay Raut


Roll No.: SIA78

import [Link].*;
class Employee
{
String emp_name;
int emp_id;
String address;
String mail_id;
String mobile_no;

double DA;
double HRA;
double PF;
double staffclubfund;
double gross_sal;
double net_sal;

void getdata()
{
Scanner sc = new Scanner([Link]);

[Link]("Enter Employee id:");


emp_id = [Link]();

[Link]("Enter Employee Name:");


emp_name= [Link]();

[Link]("Enter Employee Addrress:");


address = [Link]();

[Link]("Enter Employee Mail id:");


mail_id = [Link]();

[Link]("Enter employee Mobile Number:");


mobile_no = [Link]();
}

void setdata()
{
[Link]("******************************");
[Link]("Employee Name:"+emp_name);
[Link]("Employee Id:"+emp_id);
[Link]("Employee Address:"+address);
[Link]("Employee Mail id:"+mail_id);
[Link]("Employee Mobile number:"+mobile_no);
}

void salaray_rec(double basic_sal)


{
DA = 0.97 * basic_sal;
HRA = 0.10 * basic_sal;
PF = 0.12 * basic_sal;
staffclubfund = 0.001 * basic_sal;
gross_sal = basic_sal + DA + HRA;
net_sal = gross_sal - (PF + staffclubfund);

[Link]("DA of Basic salary:"+DA);


[Link]("HRA of basic salary:"+HRA);
[Link]("PF of Basic salary:"+PF);
[Link]("SCF of Basic salary:"+staffclubfund);
[Link]("Gross salary:"+gross_sal);
[Link]("Net salary:"+net_sal);
}
}

class programmer extends Employee {


double basic_sal;

void getsalary()
{
Scanner sc = new Scanner([Link]);
[Link]("ENtr Basic salaray");
basic_sal = [Link]();
}

void salaray_rec() {
super.salaray_rec(basic_sal);
}
}
class TeamLead extends Employee {
double basic_sal;

void getsalary()
{
Scanner sc = new Scanner([Link]);
[Link]("ENtr Basic salaray");
basic_sal = [Link]();
}

void salaray_rec() {
super.salaray_rec(basic_sal);
}
}

class AssistantProjectManager extends Employee {


double basic_sal;

void getsalary()
{
Scanner sc = new Scanner([Link]);
[Link]("ENtr Basic salaray");
basic_sal = [Link]();
}

void salaray_rec() {
super.salaray_rec(basic_sal);
}
}

class ProjectManager extends Employee {


double basic_sal;

void getsalary()
{
Scanner sc = new Scanner([Link]);
[Link]("ENtr Basic salaray");
basic_sal = [Link]();
}

void salaray_rec() {
super.salaray_rec(basic_sal);
}
}

public class Main


{
public static void main(String[] args)
{
[Link]("For programmer : ");
programmer e = new programmer();
[Link]();
[Link]();
[Link]();
e.salaray_rec();
[Link]("\n\n\nFor TeamLead : ");
TeamLead t = new TeamLead();
[Link]();
[Link]();
[Link]();
t.salaray_rec();

[Link]("\n\n\nFor Assistant Project Manager : ");


AssistantProjectManager t = new AssistantProjectManager();
[Link]();
[Link]();
[Link]();
t.salaray_rec();

[Link]("\n\n\nFor Project Manager : ");


ProjectManager t = new ProjectManager();
[Link]();
[Link]();
[Link]();
t.salaray_rec();
}
}

Output :
For programmer :
Enter Employee id:1
Enter Employee Name:Rohan
Enter Employee Addrress:Pune
Enter Employee Mail id:rohan@123
Enter employee Mobile Number:1234567890
******************************
Employee Name:Rohan
Employee Id:1
Employee Address:Pune
Employee Mail id:rohan@123
Employee Mobile number:1234567890
ENtr Basic salaray
50000
DA of Basic salary:48500.0
HRA of basic salary:5000.0
PF of Basic salary:6000.0
SCF of Basic salary:50.0
Gross salary:103500.0
Net salary:97450.0

For TeamLead :
Enter Employee id:101
Enter Employee Name:John
Enter Employee Addrress:Mumbai
Enter Employee Mail id:john@[Link]
Enter employee Mobile Number:1928374650
ENtr Basic salaray
100000
******************************
Employee Name:John
Employee Id:101
Employee Address:Mumbai
Employee Mail id:john@[Link]
Employee Mobile number:1928374650
DA of Basic salary:97000.0
HRA of basic salary:10000.0
PF of Basic salary:12000.0
SCF of Basic salary:100.0
Gross salary:207000.0
Net salary:194900.0

For Assistant Project Manager :


Enter Employee id:201
Enter Employee Name:Soham
Enter Employee Addrress:Nashik
Enter Employee Mail id:soh@[Link]
Enter employee Mobile Number:1910293847
ENtr Basic salaray
120000
******************************
Employee Name:Soham
Employee Id:201
Employee Address:Nashik
Employee Mail id:soh@[Link]
Employee Mobile number:1910293847
DA of Basic salary:116400.0
HRA of basic salary:12000.0
PF of Basic salary:14400.0
SCF of Basic salary:120.0
Gross salary:248400.0
Net salary:233880.0

You might also like