Saturday, July 27, 2013

java Program to Create an Application that Represents Biodata Form

 Program to Create an Application that Represents Biodata Form
import java.lang.*;
import java.io.*;
class EmployeeS
{
int age, num;
String nme, add;
void emp_Info(int x)
{
try
{
num = x;
DataInputStream dts=new DataInputStream(System.in);
System.out.println("Enter Your Name:");
nme = dts.readLine();
System.out.println("\nEnter Your Address:");
add = dts.readLine();
System.out.println("\nEnter Your Age:");
age = Integer.parseInt(dts.readLine());
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
class EmployeeM extends EmployeeS
{
String dep;
int sal;
void emp_dep(int da)

{
try
{
DataInputStream pts=new DataInputStream(System.in);
System.out.println("\nEnter your Department:");
dep = pts.readLine();
System.out.println("\nEnter your Salary:");
sal = Integer.parseInt(pts.readLine());
sal = sal-((sal*da)/100);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
class EmployeeF extends EmployeeM
{
void show_info()
{
System.out.println("\nThe name of Employee is:" + nme);
System.out.println("\nThe number of Employee is:" + num);
System.out.println("\nThe address of Employee is:"
+ add);
System.out.println("\nThe age of Employee is:" + age);
System.out.println("\nThe department of Employee is:"
+ dep);
System.out.println("\nThe salary of Employee is:" + sal);
}
}
class Main
{

public static void main(String arg[])
{
EmployeeF ep = new EmployeeF();
ep.emp_Info(30);
ep.emp_dep(5);
ep.show_info();
}
}
Output:

No comments:

Post a Comment