Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A private college in Johor Bahru sets that all the instructors should teach only 20 hours per week. However, due to increment demand of students
A private college in Johor Bahru sets that all the instructors should teach only 20 hours per week.
However, due to increment demand of students intake, in certain semester, the instructors may
teach more than 20 hours per week. Hence, the instructors are allowed to claim part time
allowance if they teach more than 20 hours in a week for any semesters and they are paid RM100
per hour.
This college would like to have an online allowance system to ease the Finance Department in
part time allowance calculation. The instructors who are eligible to receive the allowance need
to fill in all their particular such as staff id, full name, faculty and teaching hours in a week. The
teaching hours details include hours for lecture sessions, lab work sessions and tutorial
sessions. Once the details have been submitted into the system, their application details are
viewed by the respective Head of Department to be approved. The approved application is
directed through the system to the Finance Department. The Finance Department is responsible
to check for any flaws of the allowance applications, and produce a part time allowance slip if all
the details are correct. Then, the part time allowance report can be seen by the respective
instructors and their respective Head of Department for their own financial reference.
public class Instructor
{
private int id;
private String name;
private String Faculty;
private int workHrs;
public Instructor(int id, String name, String Faculty, int workHrs)
{
this.id = id;
this.name = name;
this.Faculty = Faculty;
this.workHrs = workHrs;
}
public void setInstructor(int id, String name, String Faculty, int workHrs)
{
this.id = id;
this.name = name;
this.Faculty = Faculty;
this.workHrs = workHrs;
}
public int getId()
{
return id;
}
public String getName()
{
return name;
}
public String getFaculty()
{
return Faculty;
}
public int getWorkHrs()
{
return workHrs;
}
public String toString()
{
return(" Instruc ID: " + id + " Instruc Name: " + name + " Instruc Faculty: " + Faculty + " Instruc Work Hours: " + workHrs);
}
}
public class Allowance
{
private Instructor allowaTeac;
private int teachHrs;
public Allowance(int StaffId, String FullName, int teachHrs,String Faculty, int workHrs)
{
allowaTeac = new Instructor(StaffId,FullName,Faculty,workHrs);
this.teachHrs = teachHrs;
}
public void setData(int StaffId, String FullName, int teachHrs,String Fcaulty, int workHrs)
{
allowaTeac = new Instructor(StaffId,FullName,Faculty,workHrs);
this.teachHrs = teachHrs;
}
public int getAllowaTeac_Id()
{
return allowaTeac.getId();
}
public String getAllowaTeac_Name()
{
return allowaTeac.getName();
}
public String getAllowaTeac_Faculty()
{
return allowaTeac.getFaculty();
}
public int getAllowaTeac_WorkHrs()
{
return allowaTeac.getWorkHrs();
}
public int getTeachHrs()
{
return teachHrs;
}
public double claim()
{
double claim = 0.00;
return claim;
}
}
public class TeachDetail
{
private int hrsForLect;
private int hrsForLab;
private int hrsForTutorial;
public TeachDetail(int hrsForLect, int hrsForLab, int hrsForTutorial)
{
this.hrsForLect = hrsForLect;
this.hrsForLab = hrsForLab;
this.hrsForTutorial = hrsForTutorial;
}
public void setTeachDetail(int hrsForLect, int hrsForLab, int hrsForTutorial)
{
this.hrsForLect = hrsForLect;
this.hrsForLab = hrsForLab;
this.hrsForTutorial = hrsForTutorial;
}
public int getHrsForLect()
{
return hrsForLect;
}
public int getHrsForLab()
{
return hrsForLab;
}
public int getHrsForTutorial()
{
return hrsForTutorial;
}
public double teach()
{
double teach = 0.00;
teach = hrsForLect + hrsForLab + hrsForTutorial;
return teach;
}
public String toString()
{
return(" Hours for Lecture: " + hrsForLect + " Hours for Lab: " + hrsForLab + " Hours for Tutorial: "
+ hrsForTutorial + " Total hours Teach: " + teach());
}
}
public class HOD
{
private String FullName;
private String Faculty;
public HOD(String FullName, String Faculty)
{
this.fullName = FullName;
this.faculty = Faculty;
}
public void setHOD(String FullName, String Faculty)
{
this.fullName = FullName;
this.faculty = Faculty;
}
public String getFullName()
{
return FullName;
}
public String getFaculty()
{
return Faculty;
}
}
public class FinanceDpt
{
private int StaffID;
private String FullName;
public FinanceDpt(int StaffID, String FullName)
{
this.StaffID = StaffID;
this.FullName = FullName;
}
public void setFinanceDpt(int StaffID, String FullName)
{
this.StaffID = StaffID;
this.FullName = FullName;
}
}
question:Once you have completed the proposed class definition, then write the code for the
application class where an array of objects is declared. The application is designed to test
ALL methods in the class that you have written previously in b. The program must include the
implementation of basic algorithms; maximum, minimum, counting, total, average and
searching.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started