Monday, April 21, 2008

EMPLOYEE

class Employee
{
int rollno;
String name;
int m1;
int m2;
int m3;
void getdata(int roll,String a,int x1,int x2,int x3)
{
rollno=roll;
name =a;
m1=x1;
m2=x2;
m3=x3;
}
void sum()
{
int sum=0;
float avg=0;
sum=(m1+m2+m3);
avg=sum/3;
System.out.println("The roll number is......"+rollno);
System.out.println("Name.........."+name);
System.out.println("Average......."+avg);
}
}
class Employeedemo
{
public static void main(String args[])
{
Employee E= new Employee();
E.getdata(26,"WHATEVER",100,100,100);
E.sum();
}
}

No comments: