Displaying Source Code(s)
|
|
Employee details
--------------------------------------------------------------------------------
Description : THIS IS A SCHEDULING ALGORITHAM OF TYPE NON-PREEMPTIVE.THAT
MEANS THE PROCESS HAVING CALCULATE A EMPLOYEE DETAILS TIME WILL
BE PROCESSED NEXT.THIS PROGRAM WILL BE HELP FULL TO STUDY THE
BASIC JAVA.
Code :
/*PROGARM FOR CREATE A EMPLOYEE DETAILS*/
import java.lang.*;
import java.io.*;
class Employee
{
int empno;
String name;
Employee()
{
try
{
DataInputStream d=new DataInputStream(System.in);
System.out.println("name of the employee<BR>);
name=d.readLine();
System.out.println("Employy no:");
empno=Integer.parseInt(d.readLine());
}
catch(IOException e)
{
System.out.println("ioerror");
}
}
void Display()
{
}
}
class manager extends Employee
{
String desig;
int bp;
int hra;
int ta=100,da,inc;
manager()
{
try
{
DataInputStream d=new DataInputStream(System.in);
System.out.println("salary is<BR>);
bp=Integer.parseInt(d.readLine());
System.out.println("desig of the employee<BR>);
desig=d.readLine();
hra=(bp*10)/100;
da=(bp*5)/100;
inc=(bp*15)/100;
}
catch(IOException e1)
{
System.out.println("error");
}
}
void Display()
{
System.out.println(name+" "+empno+" "+desig+" "+" "+(bp+hra+da+ta+inc)
);
}
}
class Typist extends Employee
{
int bp;
String desig;
int hra;
int ta=0,da,inc;
Typist()
{
try
{
DataInputStream d=new
DataInputStream(System.in);
System.out.println("salary is<BR>);
bp=Integer.parseInt(d.readLine());
System.out.println("desig of the employee<BR>);
desig=d.readLine();
hra=(bp*8)/100;
da=(bp*4)/100;
inc=(bp*10)/100;
}
catch(IOException e1)
{
System.out.println("error");
}
}
void Display()
{
System.out.println(name+" "+empno+" "+desig+" "+" "+(bp+hra+da+ta+inc)
);
}
}
public class lab1
{
public static void main(String args[]) throws IOException
{
manager m=new manager();
Typist t=new Typist();
System.out.println(" EMPLOYEE DETAILS" );
System.out.println(" ~~~~~~~~~~~~~~~~" );
System.out.println("Name Code Designation
Salary ");
System.out.println("~~~~ ~~~~ ~~~~~~~~~~~
~~~~~~ ");
m.Display();
t.Display();
}
} |
|
|