Question: JAVA please answer all questions QUESTION 3 One IT Solution Sdn Bhd is a software house company. They are planning to provide a system to

JAVA

JAVA please answer all questions QUESTION 3 One IT Solution Sdn Bhd

is a software house company. They are planning to provide a system

please answer all questions

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 KindergartenTeacher subclasses which are inherited from Teacher superclass. Superclass: Teacher Attributes: String name; String icNo; Il identification card no String subjectTaught; // English, Math, History int yos; Il year of service Methods: normal constructor accessor methods toString() abstract double calcsalary i/teacher grade, e.g: DG41, DG44, DG48 Subclass: School Teacher Attributes: String grade; 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() a) Write the normal constructor for subclass School Teacher. (2 marks) b) Write the definition of method calcSalary() for both subclasses that calculate and return 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 i. 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

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!