Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  employ.java
Language: JAVA
Code:
class Employee
{
String name,designation;
int id,salry,age,basic_pay;
void setValues(int id, int a,int salry,int bpay,String n,String desgn){
id=id;
age=a;
basic_pay=bpay;
name=n;
designation=desgn;
}
void calSalry(){
salry=(10%basic_pay + 35%basic_pay + basic_pay);
}
void display(){
System.out.println(id + "\t" +name);
System.out.println(age + "\t" +designation);
System.out.println(basic_pay + "\t" +sal);
}
class EmployeeDemo{
public static void main(String[] args){
Employee x;
x=new Employee();
x.setValues(501, 39, 54000,"Rishi","PROGRAMMER ANALYST");
x.calSalry();
x.display();
Employee x1;
x1=new Employee();
x1.setValues(502, 27, 67000, "Rohith","SOFTWARE DEVELOPER");
x1.calSalry();
x1.display();
Employee x2;
x2=new Employee();
x2.setValues(503, 49, 75000, "Rajesh", "TL");
x2.calSalry();
x2.display();
}
}
}
Comments: