Professional Documents
Culture Documents
ASSIGNMENT 02
Marks: 5
Part A:
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
Part B:
//Application Class
package First;
//Staff
OfficeStaff x3 = new OfficeStaff ("01", "Hamza", "Budget Analyst", 25000, 75);
OtherStaff x4 = new OtherStaff ("02", "Raheel", "Auditor", 15000, 50);
System.out.println("\n==============================");
System.out.println(" Office Staff");
System.out.println("==============================\n");
System.out.println(x3);
System.out.println("\n==============================");
System.out.println(" Other Staff");
System.out.println("==============================\n");
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
System.out.println(x4);
//Faculty
PermanentFaculty x5 = new PermanentFaculty ("030", "Benny", "Intern", 5000,
90);
PermanentFaculty x6 = new PermanentFaculty ("031", "Blanc", "Software
Developer", 7000, 60);
TemporaryFaculty x7 = new TemporaryFaculty ("051", "Liza", "Social Media
Manager", 13000, 75);
System.out.println("\n==============================");
System.out.println(" Permanent Faculty");
System.out.println("==============================\n");
System.out.println(x5);
System.out.println("\n" + x6);
System.out.println("\n==============================");
System.out.println(" Temporary Faculty");
System.out.println("==============================\n");
System.out.println(x7);
}
}
//Employee
public class Employee
{
private String ID;
private String Name;
private String Designation;
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
//Administration
public class Administration extends Employee
{
private double Attendance;
private double Increment;
Administration (String ID, String Name, String Designation, double Salary, double
Att)
{
super(ID, Name, Designation, Salary);
Attendance = Att;
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
else
{
TotalSalary = Salary;
}
return TotalSalary;
}
//Staff
public class Staff extends Employee
{
protected double Attendance;
protected double Increment = 0;
Staff (String ID, String Name, String Designation, double Salary, double Att)
{
super(ID, Name, Designation, Salary);
Attendance = Att;
}
}
//OfficeStaff
public class OfficeStaff extends Staff
{
OfficeStaff (String ID, String Name, String Designation, double Salary, double
Attendance)
{
super(ID, Name, Designation, Salary, Attendance);
}
else
{
TotalSalary = Salary;
}
return TotalSalary;
}
//OtherStaff
public class OtherStaff extends Staff
{
OtherStaff (String ID, String Name, String Designation, double Salary, double
Attendance)
{
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
else
{
TotalSalary = Salary;
}
return TotalSalary;
}
//Faculty
public class Faculty extends Employee
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
{
protected double Performance;
protected double Increment = 0;
Faculty (String ID, String Name, String Designation, double Salary, double perform)
{
super(ID, Name, Designation, Salary);
Performance = perform;
}
}
//PermanentFaculty
public class PermanentFaculty extends Faculty
{
PermanentFaculty (String ID, String Name, String Designation, double Salary, double
Performance)
{
super(ID, Name, Designation, Salary, Performance);
}
else
{
TotalSalary = Salary;
}
return TotalSalary;
}
//TemporaryFaculty
public class TemporaryFaculty extends Faculty
{
TemporaryFaculty (String ID, String Name, String Designation, double Salary, double
Performance)
{
super(ID, Name, Designation, Salary, Performance);
Department of Computer Science CSC-210:Object-Oriented Programming
Bahria University Karachi Campus Semester 02 (SPRING 2021)
else
{
TotalSalary = Salary;
}
return TotalSalary;
}