0% found this document useful (0 votes)
20 views3 pages

Employee

Uploaded by

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

Employee

Uploaded by

Senthil Velan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

import java.util.

scanner;
class Employee
{
int id;
String name ,address,mail,mno;
Scanner get =new Scanner (system.in);
Empleyee()
{
System.out.println("Enter Name of the Employee:");
name=get.nextLine();
System.out.println("Enter mailid of the Employee:");
mail=get.nextLine();
System.out.println("Enter Address of the Employee:");
address=get.nextLine();
System.out.println("Enter mobile no.of the Employee:");
mno=get.nextLine();
System.out.println("Enter id:");
id=get.nextlnt();
}
void display()
{
System.out.println("Employee Name:"+name);
System.out.println("ID:"+id);
System.out.println("Mail Id:"+mail);
System.out.println(Address:"+address);
System.out.println(Mobile No:"+mno);
}
}
class programmer extends Employee
{
float grosssalary,netsalary;
float bpay;
programmer()
{
System.out.println("Enter Basic pay:");
bpay=get.nextFloat();
grosssalary=(0.97f*bpay)+(0.10f*bpay)+(0.12f*bpay)+(0.001f*bpay)+bpay;
net salary=(0.97f*bpay)+(0.10f*bpay)+bpay;
}
void display()
{
System.out.println("========"+"\n"+"programmer"+"========="+"\n");
super.display();
System.out.println("Grosssalary:"+grosssalary);
System.out.println("Net salary:"+ netsalary);
}
}
class Assistantprofessor exends Employee
{
Float grosssalary,nextsalary;
Float bpay;
Assistantprofessor()
{
System.out.println("Enter Basic pay:");
bpay=get.nextfloat();
grosssalary=(0.97f*bpay)+(0.10f*bpay)+(0.12f*bpay)+(0.001f*bpay)+bpay;
netsalary=(0.97f*bpay)+(0.10f*bpay)+bpay;
}
void display()
{
System.out.println("========"+"\n"+"Associate professor"+"\n"+"========"+"\n);
super.display();
System.out.println("gross salary:");
System.out.println("net salary:"+netsalary);
}
}
class AssociateProfessor extends Employee
{
float grosssalary,netsalary;
float bpay;
AssociateProfessor()
{
System.out.println("enter basic pay:")
bpay=get.nextFloat();
grosssalary=(0.97f*bpay)+(0.10f*bpay)+(0.12f*bpay)+(0.001f*bpay)+bpay;
netsalary=(0.97f*bpay)+(0.10f*bpay)+bpay;
}
void display()
{
System.out.println("========"+"\n"+"associateprofessor"+"\n"+"======"+"\n");
super.display();
System.out.println("gross salary:"+grosssalary);
System.out.println("net salary:"+netsalary);
}
}
class Associate professor extends Employee
{
Float grosssalary,netsalary;Float bpay;Associate professor()
{
System.out.println(Enter Basic pay:");
bpay=get.nextFloat();
Grosssalary=(0.97f*bpay)+(0.10f*bpay)+(0.12f*bpay)+(0.001f*bpay)+bpay;
netsalary=(0.97f*bpay)+(0.10f*bpay)+bpay;
}
void display()
{
System.out.println("========="+"\n"+"Associate professor "+"\n"+"========="+"\n");
Super.display();
System.out.println("Gross salary:"+grosssalary);
System.out.println(Net salary:"+netsalary);
}
}
class professor extends Employee
{
Float grosssalary,netsalary,float bpay;
professor()
{
System.out.println("Enter Base Pay:");bpay=get.nextFloat();
grosssalary=(0.97f*bpay)+(0.10f*bpay)+(0.12f*bpay)+(0.001f*bpay)+bpay;
netsalary=(0.97f*bpay)+(0.10f*bpay)+bpay;
}
void display()
{
System.out.println("======="+"\n"+"Associate Professor"+"\n"+"========="+"\n);
Super.display();
System.out.println("Gross salary:"+ grosssalary);
System.out.println("Net salary:"+netsalary);
}
}
class Employees
{
Public static void main (string args[])
{
System.out.println("==========="+"\n"+" Enter Professor Details"+"\
n"+"============"+"\n");

Professor ob1=new professor();


ob1.display();
Associate Professor ob2=new Associate profeesor();
system.out.println("==============="+"\n"+"Enter Associate Professor Details"+"\
n"+"==================="+"\n");
ob2.display();
Assistant Professor ob3=new Assosiate professor();
system.out.println("==================="+"\n"+" Enter Assosiate Professor
Details"+"\n"+"==================="+"\n");
ob3.display();
Programmer ob4=new programmer();
system.out.println("==============="+"\n"+"Enter Programmer Details"+"\
n"+"===================="+"\n");
ob4.display();
}
}

You might also like