Question: Java One IT Solution Sdn Bhd is a software house company. They are planning to provide a system to store data about teachers. Given School

One IT Solution Sdn Bhd is a software house company. They are planning to provide a system to store data about teachers. Given School Teacher and KindergartenTeacher subclasses which are inherited from Teacher superclass. are Superclass: Teacher Attributes: String name; String icNo; // identification card no String subject Taught; // English, Math, History int yos; 11 year of service Methods: normal constructor accessor methods toString() abstract double calcSalary() Subclass: School Teacher Attributes: String grade; Il teacher grade, e.g: DG41, DG44, DG48 Methods: normal constructor accessor method toString() double calcSalary() Subclass: Kindergarten Teacher Attributes: int otHours; llovertime hours per month Methods: normal constructor accessor method toString() double calcSalary() b) Write the definition of method calcSalary() for both subclasses that calculate and return the teacher's salary based on the following information. i. The salary of school teacher is calculated based on the grade as shown in Table 1: Table 1 : School Teacher Salary Grade Salary (RM) DG41 2000 DG44 3400 DG48 5000 DG52 5600 ii. For kindergarten teachers, the salary is calculated based on the year of service as shown in Table 2 and overtime hours. Table 2: Kindergarten Teacher Salary Year of Service Basic salary (RM) 5 2100 Each overtime hour will be paid RM15. Salary for the kindergarten teachers is the total of basic salary and overtime hours pay. (6.5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
