Employee Pay Slip Generation

/*
Develop a java application with Employee class with Emp_name, Emp_id, Address, Mail_id, Mobile_no as members. Inherit the classes, Programmer, Assistant Professor, Associate Professor and Professor from employee class. Add Basic Pay (BP) as the member of all the inherited classes with 97% of BP as DA, 10 % of BP as HRA, 12% of BP as PF, 0.1% of BP for staff club fund. Generate pay slips for the employees with their gross and net salary.
*/
 
import java.util.*;
 
class Employee
{
     String Emp_name;
     int Emp_id;
     String Address;
     String Mail_id;
     long Mobile_no;
    
     Scanner s = new Scanner(System.in);
    
     public void fnRead()
     {
          System.out.print(“Enter name : “);
          Emp_name = s.nextLine();
         
          System.out.print(“Enter ID : “);
          Emp_id = Integer.parseInt(s.nextLine());
         
          System.out.print(“Enter Address : “);
          Address = s.nextLine();
         
          System.out.print(“Enter mail ID : “);
          Mail_id = s.nextLine();
         
          System.out.print(“Enter mobile number : “);
          Mobile_no = s.nextLong();
     }
    
     public void fnDisplay()
     {
          System.out.println(“\n\n\t\t ***** Employee Salary Details *****”);
          System.out.println(“Name : ” + Emp_name);
          System.out.println(“Emp_ID : ” + Emp_id);
          System.out.println(“Address : ” + Address);
          System.out.println(“Mail ID : ” + Mail_id);
          System.out.println(“Mobile number : ” + Mobile_no);
     }
}
 
class Programmer extends Employee
{
     double BP, DA, HRA, PF, SCF;
     double Gross_sal, Net_sal;
    
     Programmer()
     {
          BP = 8000;
     }
    
     public void fnCalc()
     {
          DA = 0.97 * BP;
          HRA = 0.10 * BP;
          PF = 0.12 * BP;
          SCF = 0.001 * BP;
 
          Gross_sal = BP + DA + HRA;
          Net_sal = Gross_sal – PF – SCF;
         
          System.out.println(“Salary Details : “);
          System.out.println(“Basic : ” + BP);
          System.out.println(“Dearness Allowance : ” + DA);
          System.out.println(“HRA : ” + HRA);
          System.out.println(“PF : ” + PF);
          System.out.println(“Staff Club Fund : ” + SCF);
          System.out.println(“Gross Salary : ” + Gross_sal);
          System.out.println(“Net Salary : ” + Net_sal);
    
     }
}
 
class AssistantProfessor extends Employee
{
     double BP, DA, HRA, PF, SCF;
     double Gross_sal, Net_sal;
    
     AssistantProfessor()
     {
          BP = 15600;
     }
    
     public void fnCalc()
     {
          DA = 0.97 * BP;
          HRA = 0.10 * BP;
          PF = 0.12 * BP;
          SCF = 0.001 * BP;
 
          Gross_sal = BP + DA + HRA;
          Net_sal = Gross_sal – PF – SCF;
         
          System.out.println(“Salary Details : “);
          System.out.println(“Basic : ” + BP);
          System.out.println(“Dearness Allowance : ” + DA);
          System.out.println(“HRA : ” + HRA);
          System.out.println(“PF : ” + PF);
          System.out.println(“Staff Club Fund : ” + SCF);
          System.out.println(“Gross Salary : ” + Gross_sal);
          System.out.println(“Net Salary : ” + Net_sal);
 
     }
}
 
class AssociateProfessor extends Employee
{
     double BP, DA, HRA, PF, SCF;
     double Gross_sal, Net_sal;
    
     AssociateProfessor()
     {
          BP = 37400;
     }
    
     public void fnCalc()
     {
          DA = 0.97 * BP;
          HRA = 0.10 * BP;
          PF = 0.12 * BP;
          SCF = 0.001 * BP;
 
          Gross_sal = BP + DA + HRA;
          Net_sal = Gross_sal – PF – SCF;
         
          System.out.println(“Salary Details : “);
          System.out.println(“Basic : ” + BP);
          System.out.println(“Dearness Allowance : ” + DA);
          System.out.println(“HRA : ” + HRA);
          System.out.println(“PF : ” + PF);
          System.out.println(“Staff Club Fund : ” + SCF);
          System.out.println(“Gross Salary : ” + Gross_sal);
          System.out.println(“Net Salary : ” + Net_sal);
         
     }
}
 
class Professor extends Employee
{
     double BP, DA, HRA, PF, SCF;
     double Gross_sal, Net_sal;
    
     Professor()
     {
          BP = 54000;
     }
    
     public void fnCalc()
     {
          DA = 0.97 * BP;
          HRA = 0.10 * BP;
          PF = 0.12 * BP;
          SCF = 0.001 * BP;
 
          Gross_sal = BP + DA + HRA;
          Net_sal = Gross_sal – PF – SCF;
         
          System.out.println(“Salary Details : “);
          System.out.println(“Basic : ” + BP);
          System.out.println(“Dearness Allowance : ” + DA);
          System.out.println(“HRA : ” + HRA);
          System.out.println(“PF : ” + PF);
          System.out.println(“Staff Club Fund : ” + SCF);
          System.out.println(“Gross Salary : ” + Gross_sal);
          System.out.println(“Net Salary : ” + Net_sal);
         
     }
}
 
class Emp_Pay_Slip
{
     public static void main(String as[])
     {
          Programmer pgmr = new Programmer();
          AssistantProfessor ap = new AssistantProfessor();
          AssociateProfessor asp = new AssociateProfessor();
          Professor prof = new Professor();
         
          Scanner s = new Scanner(System.in);
         
          System.out.println(“1 – Programmer”);
          System.out.println(“2 – Assistant Professor”);
          System.out.println(“3 – AssociateProfessor”);
          System.out.println(“4 – Professor”);
          System.out.print(“Enter designation choice : “);
             
          int choice = s.nextInt();
             
          switch(choice)
          {
              case 1:    pgmr.fnRead();
                             pgmr.fnDisplay();
                             pgmr.fnCalc();
                             break;
                  
              case 2:    ap.fnRead();
                             ap.fnDisplay();
                             ap.fnCalc();
                             break;
                       
              case 3:    asp.fnRead();
                             asp.fnDisplay();
                             asp.fnCalc();
                             break;
                       
              case 4:    prof.fnRead();
                             prof.fnDisplay();
                             prof.fnCalc();
                             break;
                       
          }
     }
}