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

 QUESTION 3 One IT Solution Sdn Bhd is a software housecompany. They are planning to provide a system to store data about

QUESTION 3 One IT Solution Sdn Bhd is a software house company. They are planning to provide a system to store data about teachers. Given are School Teacher and Kindergarten Teacher subclasses which are inherited from Teacher superclass. Superclass: Teacher Attributes: String name; String icNo; // identification card no String subject Taught; // English, Math, History int yos; // year of service Methods: normal constructor accessor methods toString() abstract double calcSalary() Subclass: School Teacher Attributes: String grade; //teacher grade, e.g: DG41, DG44, DG48 Methods: normal constructor accessor method toString() double calcSalary() Subclass: Kindergarten Teacher Attributes: int otHours; //overtime hours per month Methods: normal constructor accessor method toString() double calcSalary() a) Write the normal constructor for subclass School Teacher. (2 marks) b) Write the definition of method calesalary() for both subclasses that calculate and retum the teacher's salary based on the following information. 1) 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) c) Based on the classes given, write Java statements to do the following: 0) Declare an array of 20 Teacher objects named teach. (1 mark) 1) Display the information of English teachers who have been teaching for more than 10 years. (3 marks) ii) Display the name and salary of school teachers whose grade is DG44. (3.5 marks) iv) Calculate and display the total overtime hours done by the teachers. (4 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!